Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

server script hard crashing my studio please help?

Asked by 2 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 2 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 — 2y
Ad
Log in to vote
3
Answered by 2 years ago
Edited 2 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 — 2y

Answer this question