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

CFrame Moving Before Wait Time?

Asked by 5 years ago

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??

0
put the wait before the line 3 KDarren12 705 — 5y
0
OHH KDarren12 705 — 5y
0
let me make an answer KDarren12 705 — 5y

1 answer

Log in to vote
0
Answered by
KDarren12 705 Donator Moderation Voter
5 years ago

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
0
the amount of time depends on your internet connection and many more factors. KDarren12 705 — 5y
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 iNykoda 3 — 5y
0
maybe you dont need a wait; i think plr.Character:Wait() waits til the characters details load. KDarren12 705 — 5y
0
ah iNykoda 3 — 5y
Ad

Answer this question