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

server script hard crashing my studio please help?

Asked by 6 years ago

pls i have this script which keeps crashing my studio and i dont know how to fix it it is a loop that moves a part around a line its for my game pls help me

part = game.Workspace.skate

while true do
    part.CFrame = part.CFrame*CFrame.new(1,0,0)
    part.BrickColor = BrickColor.random()
    print("debug")
end

2 answers

Log in to vote
1
Answered by 6 years ago
part = game.Workspace.skate

while true do
    part.CFrame = part.CFrame*CFrame.new(1,0,0)
    part.BrickColor = BrickColor.random()
    print("debug")
    wait()
end
1
Thx mohamedeatpotatoes 67 — 6y
Ad
Log in to vote
3
Answered by 6 years ago
Edited 6 years ago

You have a while true do loop which is an infinite loop. ALL infinite loop needs wait() <- doesnt matter how many sec. else you will crash

    part = game.Workspace.skate

    while true do
        part.CFrame = part.CFrame*CFrame.new(1,0,0)
        part.BrickColor = BrickColor.random()
        print("debug")
        wait()
    end

1
Thx mohamedeatpotatoes 67 — 6y

Answer this question