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

I want my item to respawn when the timer reaches 0 but it gives me this error?

Asked by 3 years ago

I'm making a game with keys, I have a little timer and when it reaches zero, the key is supposed to respawn, but when I play test, it gives me this error...

"YellowSpawn is not a valid member of workspace" -- yellow spawn is the key spawn

Here is my script:

game.ReplicatedStorage.Values.Seconds.Changed:Connect(function()
    if game.ReplicatedStorage.Values.Seconds.Value == 0 then
        wait(1)
        game.ReplicatedStorage.Values.Seconds.Value = 6
        workspace.YellowKey.Handle.Position = workspace.YellowSpawn.Position -- This is the part
    end
end)

Thank you if you can help!

0
Well then it's not in the workspace MattVSNNL 620 — 3y
0
yea can collide made it fall out of the map IBulid3 4 — 3y

2 answers

Log in to vote
0
Answered by
0_2k 496 Moderation Voter
3 years ago

Ensure that your part is either anchored and/or disable collision to maintain it from moving.

Ad
Log in to vote
0
Answered by 3 years ago

If you cant find you part in workspace, can collide maybe made it fall...

Answer this question