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

Why isn't this script working, have I put too many brackets in?

Why isn't this script working?, This script is for the script to move 5 blocks in "time", so I want the block to move in the time of "time"

local time = 5
while true do 

script.Parent.CFrame = CFrame.new(script.Parent.Position+Vector3.new(0, 5, 0)(time))

1 comment

0

You forgot to close your statement with an end

2 answers

✓ Accepted answer

with a while true do loop, you should always but in a wait after it you also forgot the end

script:

local time = 5
while true do 
	script.Parent.CFrame = CFrame.new(script.Parent.Position+Vector3.new(0, 5, 0) * time) -- this might work better
	wait() 
end

3 comments

0

Thx.It worked, but not in the way I wanted. This script is for the script to move 5 blocks in "time", so I want the block to move in the time of "time"

1

oh, when it says wait() do wait(5) and remove the * time part of the equation, don't forget to mark the answer as correct then some other people with similar problems know what is correct

0

no wait five, do wait time sorry

Try this script:

local Time = 5
while true do 
	wait(5)
    script.Parent.CFrame = CFrame.new(script.Parent.Position+Vector3.new(0, 5, 0) * Time) 
    wait() 
end

** Yours sincerely,**

JesseSong

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