Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Error while changing value?

i keep geting a error that gamestart is not in workspace, im not sure why so please help, thx for reading.

local Players = game.Players:GetPlayers()
	for i,v in pairs(Players) do
  v.Character.Torso.CFrame = CFrame.new(target2)
wait()
game.Workspace.Gamestart.Value = true
wait(0.5)
game.Workspace.Gamestart.Value = false
end

4 comments

0

So is Gamestart in a folder or not?

0

Not sorry.

0

Is that exactly how Gamestart is spelled? Exact spaces, capitals, etc?

0

Yes EXACT

1 answer

✓ Accepted answer

The script may be working too fast for the game. Try putting this into the script:

repeat wait() until game.Workspace:FindFirstChild("Gamestart")

This just repeats a loop until the object is found, to prevent it comming up as nil. (This could also be accomplished using :WaitForChild() , but I always run into problems using that)


So this entire script should be this:

local Players = game.Players:GetPlayers()
for i,v in pairs(Players) do
	v.Character.Torso.CFrame = CFrame.new(target2)
	wait()
	repeat wait() until game.Workspace:FindFirstChild("Gamestart")
	game.Workspace.Gamestart.Value = true
	wait(0.5)
	game.Workspace.Gamestart.Value = false
end

If you have any further problems/questions, please leave a comment below. Hope I helped :P

2 comments

0

Instead of that long code why don't you put game.Workspace:WaitForChild("Gamestart"). Edited: You mention that like 13 second before I could  post xD

0

Lol, I literally just updated my answer right before your comment

This discussion is preserved as it was. New answers, comments, and votes are closed.