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

This script is crashing my game and I don't know why. Anybody help?

Asked by 7 years ago
Edited 7 years ago

Here is my script:

while true do
    local BrickColo = BrickColor.Random()
    script.Parent.BrickColor = BrickColo
    wait(1)
end

It worked perfectly but then after a few days it just started crashing my game!

0
Are you sure this is the source of the error and not some other script you implemented? M39a9am3R 3210 — 7y
0
Yes. It points an arrow to line 2 when I click break script. Neodosa 7 — 7y
0
do while wait(0.1) do and it wont crash at all! JohnJohniamm55 21 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago

Hold on... This script seems to be causing this. When I disable the script up there it still crashes and it blames it on another script... But when I disable this script:

while script.Parent.Value.Value == 1 do
    if script.Parent.ValueA.Value < 5 then
        wait(2)
        local ne = script.Parent.ClonePaer:Clone()
        ne.Parent = script.Parent.Modela
        ne.Anchored = false
        ne.Position = script.Parent.Position
        script.Parent.ValueA.Value = script.Parent.ValueA.Value + 1
    end
end

It all works perfectly.

0
But I still need answers Neodosa 7 — 7y
0
I found the problem. I forgot some wait. Neodosa 7 — 7y
0
Modela? may be problem GimmeWaffleBruh 18 — 7y
Ad
Log in to vote
0
Answered by 7 years ago
while wait(1) do
    script.Parent.BrickColor = BrickColor:Random()
end

:)

Answer this question