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

What's wrong here / Why is the script not repeating properly? Is it broken?

Here's the script : [Named TurnL]

while true do
	script.Parent.TurnLF.BrickColor = BrickColor.new("Br. yellowish orange")
	script.Parent.TurnLF.SpotLight.Enabled = true
	wait ()
	script.Parent.TurnLF.BrickColor = BrickColor.new("Really black")
	script.Parent.TurnLF.SpotLight.Enabled = false
end

Here's the script that will Activate it. [A Script inside a block, Inside a model to activate TurnL.]

on = false
script.Parent.ClickDetector.MouseClick:connect(function(click)
if on == false then
on = true
script.Parent.Parent.TurnL.Disabled = false
else
on = false
script.Parent.Parent.TurnL.Disabled = true
end
end)

[TurnLF Is Spelled properly, TurnLF has the SpotLight in it, It's in the correct location.]

I have a separate clickdetector with a script in it which activates this script, Clicking again will deactivate it. However, it decides not to loop when activated and only changes the BrickColor and turns on the SpotLight?

How would i get it to Properly loop when the script is activated? I've tried everything I could think of to fix it. Even tried messing around with Script + Block Names.

1 comment

0

The script is working but I think its cause you added "wait()" in the brackets you didnt type any numbers cause if you just wait for zero seconds its not gonna look like anything has changed. if you want it to quickly change then just change it to wait(0.1) or something like that.

1 answer

✓ Accepted answer

The problem is that you have no wait between switching colours at the end of the loop before it loops again(so there is no noticeable difference)

fix)


while true do
    script.Parent.TurnLF.BrickColor = BrickColor.new("Br. yellowish orange")
    script.Parent.TurnLF.SpotLight.Enabled = true
    wait ()
    script.Parent.TurnLF.BrickColor = BrickColor.new("Really black")
    script.Parent.TurnLF.SpotLight.Enabled = false
wait()
end

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