generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: This small script isn't working, can anyone help?

Previous Thread :: Next Thread 
Vurse is not online. Vurse
Joined: 15 Apr 2013
Total Posts: 826
08 Oct 2013 10:17 PM
This script isn't working, can anyone help? It should make a spawn point whenever it's parent is in workspace.

if script.Parent == workspace then

spawn=Instance.new("SpawnLocation", workspace) -- 2nd optional argument for creating an Instance is it's parent
spawn.CFrame = CFrame.new(632.715, 12.24, -155.688) -- to avoid any positioning errors when interacting with players
if script.Parent ~= workspace then
spawn:Remove()
end
end
Report Abuse
Vurse is not online. Vurse
Joined: 15 Apr 2013
Total Posts: 826
08 Oct 2013 10:22 PM
(This whole thing is so that I can make generating and degenerating maps work correctly for me)
Report Abuse
Vurse is not online. Vurse
Joined: 15 Apr 2013
Total Posts: 826
08 Oct 2013 10:33 PM
Eh... Anyone want to help?
Report Abuse
Masterdraketrey is not online. Masterdraketrey
Joined: 12 May 2012
Total Posts: 10737
08 Oct 2013 10:35 PM
Hmmm....
Report Abuse
Vurse is not online. Vurse
Joined: 15 Apr 2013
Total Posts: 826
08 Oct 2013 10:42 PM
Hmmm..?
Report Abuse
madness725 is not online. madness725
Joined: 19 Apr 2011
Total Posts: 2058
08 Oct 2013 10:43 PM
I dont see a problem with it
Report Abuse
Undertaker4012 is not online. Undertaker4012
Joined: 21 Jul 2013
Total Posts: 476
08 Oct 2013 10:44 PM
Me niether.
Report Abuse
madness725 is not online. madness725
Joined: 19 Apr 2011
Total Posts: 2058
08 Oct 2013 10:46 PM
^Undertaker, I noticed you have like, The entire Undertaker bio in your blurb. You don't actually think you think your fooling people into thinking your undertaker do you?
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
08 Oct 2013 10:46 PM
If script.parent.Name ="Workspace"
Report Abuse
Masterdraketrey is not online. Masterdraketrey
Joined: 12 May 2012
Total Posts: 10737
08 Oct 2013 10:47 PM
When you say spawn your making a new spawn

So say spawn.....
Then saying it again is making it brake


Try
Changing the name of spawn once by saying something like
"game.Workspace. SpawnLocation.name = S1

The add rest of script

Report Abuse
Vurse is not online. Vurse
Joined: 15 Apr 2013
Total Posts: 826
08 Oct 2013 10:48 PM
Well actually I'm worse than anyone in Roblox at scripting, does anyone think they can rewrite it correctly? .-.
Report Abuse
Masterdraketrey is not online. Masterdraketrey
Joined: 12 May 2012
Total Posts: 10737
08 Oct 2013 10:51 PM

if script.Parent == workspace then

spawn=Instance.new("SpawnLocation", workspace) -- 2nd optional argument for creating an Instance is it's parent
game.Workspace. SpawnLocation.name = S1

S1.CFrame = CFrame.new(632.715, 12.24, -155.688) -- to avoid any positioning errors when interacting with players
if script.Parent ~= workspace then
spawn:Remove()
end
end
Or something like this
Report Abuse
Vurse is not online. Vurse
Joined: 15 Apr 2013
Total Posts: 826
08 Oct 2013 10:57 PM
Er.. But then what's the point of the part of the script that says "spawn=Instance.new(ect.)"
Report Abuse
Masterdraketrey is not online. Masterdraketrey
Joined: 12 May 2012
Total Posts: 10737
08 Oct 2013 11:04 PM
If there no spawns ingame
Thats the point
Report Abuse
Vurse is not online. Vurse
Joined: 15 Apr 2013
Total Posts: 826
08 Oct 2013 11:08 PM
But aren't you naming two things in this script, at one point you name spawn, which = instance new (ect.) then later you name the spawn S1, part of the script uses "S1" and the other part uses "spawn"? Are you sure this would work? .-.
Report Abuse
Masterdraketrey is not online. Masterdraketrey
Joined: 12 May 2012
Total Posts: 10737
08 Oct 2013 11:17 PM
My mistake

if script.Parent == workspace then

spawn=Instance.new("SpawnLocation", workspace) -- 2nd optional argument for creating an Instance is it's parent
game.Workspace. SpawnLocation.name = S1

S1.CFrame = CFrame.new(632.715, 12.24, -155.688) -- to avoid any positioning errors when interacting with players
if script.Parent ~= workspace then
S1:remove()
end
end
Report Abuse
Vurse is not online. Vurse
Joined: 15 Apr 2013
Total Posts: 826
08 Oct 2013 11:18 PM
If anyone were to go to studio and try and see if they can make it work.. I'd be mighty grateful.. :l
Report Abuse
Masterdraketrey is not online. Masterdraketrey
Joined: 12 May 2012
Total Posts: 10737
08 Oct 2013 11:19 PM
Your on your phone?
Report Abuse
Vurse is not online. Vurse
Joined: 15 Apr 2013
Total Posts: 826
08 Oct 2013 11:22 PM
I meant to say, can anyone try to rewrite the script and get it to work in anyway they think they can (I've already tried my script, and Master's edited version)
Report Abuse
Vurse is not online. Vurse
Joined: 15 Apr 2013
Total Posts: 826
08 Oct 2013 11:23 PM
It seems like so many people post different contradicting script versions and none of them are working for me, but if someone can make it work for themselves maybe they would be able to explain exatly how they got it to work..
Report Abuse
Masterdraketrey is not online. Masterdraketrey
Joined: 12 May 2012
Total Posts: 10737
08 Oct 2013 11:28 PM
Oh and instead of " if script.parent == workspace"




Use

"If local game.Players.LocalPlayer.Location = ( regular spawn location's coordinates"
Report Abuse
Masterdraketrey is not online. Masterdraketrey
Joined: 12 May 2012
Total Posts: 10737
08 Oct 2013 11:31 PM
And you should do
local game.Players.Humaniod.Health = 0

So they reset

Report Abuse
Masterdraketrey is not online. Masterdraketrey
Joined: 12 May 2012
Total Posts: 10737
08 Oct 2013 11:32 PM
Position not location btw
Report Abuse
Project2015 is not online. Project2015
Joined: 11 Sep 2013
Total Posts: 384
08 Oct 2013 11:34 PM
Change;

CFrame
To
Vector3.new
Report Abuse
Masterdraketrey is not online. Masterdraketrey
Joined: 12 May 2012
Total Posts: 10737
08 Oct 2013 11:35 PM
^
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image