Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Error while changing value?

Asked by 9 years ago

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
0
So is Gamestart in a folder or not? DigitalVeer 1473 — 9y
0
Not sorry. ioutragous 0 — 9y
0
Is that exactly how Gamestart is spelled? Exact spaces, capitals, etc? DigitalVeer 1473 — 9y
0
Yes EXACT ioutragous 0 — 9y

1 answer

Log in to vote
0
Answered by
dyler3 1510 Moderation Voter
9 years ago

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

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 UserOnly20Characters 890 — 9y
0
Lol, I literally just updated my answer right before your comment dyler3 1510 — 9y
Ad

Answer this question