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

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

Asked by 10 years ago

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

Log in to vote
1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

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.

0
Thanks! CrystalCoder 20 — 10y
Ad

Answer this question