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

I can't enable sparkles and smoke through my code?

Here is my code:

 while true do
 wait(math.random(5,30))
 local num = (math.random(1,3))
if num == 1 then
script.Parent.Sparkles.Enabled = True
wait(5)
script.Parent.Sparkles.Enabled = False
elseif num == 2 then
script.Parent.Fire.Enabled = True
wait(5)
script.Parent.Fire.Enabled = False
elseif num == 3 then
script.Parent.Smoke.Enabled = True
wait(5)
script.Parent.Smoke.Enabled = False
end
end

For some reason none of the effects happen, they are all in the block and disabled so I can't work out why, help is appreciated.

Thanks CrystalCoder

1 answer

✓ Accepted answer

First, please put all your code in a code block.

Anyways, your problem is you put script.Parent.Smoke.Enabled = False, but Lua is case sensitive. Replace True/False with true/false, aka make it lower case.

1 comment

0

Thanks!

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