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

server script hard crashing my studio please help?

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

✓ Accepted answer
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 comment

1

Thx

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 comment

1

Thx

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