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

1part = game.Workspace.skate
2 
3while true do
4    part.CFrame = part.CFrame*CFrame.new(1,0,0)
5    part.BrickColor = BrickColor.random()
6    print("debug")
7end

2 answers

Log in to vote
1
Answered by 7 years ago
1part = game.Workspace.skate
2 
3while true do
4    part.CFrame = part.CFrame*CFrame.new(1,0,0)
5    part.BrickColor = BrickColor.random()
6    print("debug")
7    wait()
8end
1
Thx mohamedeatpotatoes 67 — 7y
Ad
Log in to vote
3
Answered by 7 years ago
Edited 7 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

1part = game.Workspace.skate
2 
3while true do
4    part.CFrame = part.CFrame*CFrame.new(1,0,0)
5    part.BrickColor = BrickColor.random()
6    print("debug")
7    wait()
8end
1
Thx mohamedeatpotatoes 67 — 7y

Answer this question