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

CFrame Moving Before Wait Time?

So. I'm Trying to make a block that moves in a certain vector in which Ive got down. But I want a delay before the bricks start moving. Ive just put the "wait(5)" before the brick starts moving. Though when I go and test the game it starts moving before it is supposed too.

wait(5)
while true do
script.Parent.CFrame = script.Parent.CFrame + Vector3.new(0.5,0,0)
wait(1)
end

Any Ideas as why this wont work??

3 comments

0

put the wait before the line 3

0

OHH

0

let me make an answer

1 answer

✓ Accepted answer

Every script in the game runs when a player joins. (You know that grey screen? thats when they start running). It takes ABOUT 3 seconds for it to load you into the game, and more to load details. Use this to detect when a player joins and wait more time

game.Players.PlayerAdded:Connect(function(plr)
plr.Character:Wait()
wait(8)
while true do
script.Parent.CFrame = script.Parent.CFrame + Vector3.new(0.5,0,0)
wait(1)
end
end
end

4 comments

0

the amount of time depends on your internet connection and many more factors.

0

I just posted your script into the block and began to test it and i waited around 15 seconds but the block didnt start moving. I did try on a different block and if i put in a larger number like 20 it seemed to hold till then. Then after the time was up it started moving

0

maybe you dont need a wait; i think plr.Character:Wait() waits til the characters details load.

0

ah

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