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

Why isn't my disco script not working on command?

Asked by
Ulysies 50
10 years ago

Why isn't this working?..

01local function fun() --This is the disco part
02while true do
03script.Parent.Color = Color3.new(math.random(), math.random(), math.random())
04wait(0.5)
05end
06 
07function onChatted(msg, recipient, speaker) --Function for msg
08 
09local source = string.lower(speaker.Name)
10msg = string.lower(msg)
11 
12if (msg == "disco") then    --If noob101 says disco than disco is set to true
13fun = true
14end
15 
View all 24 lines...
0
For lines 13 and 23, I noticed you used 'fun', and there is a function named 'fun', that would result in an error: 'Attempt to compare boolean with 'fun' (a function)'. TheeDeathCaster 2368 — 10y
0
so then how do I set it as true and false? Ulysies 50 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

You need to do instead of

1fun = true

you need to do

1fun() -- to start the function!

Please accept the answer if correct and give reputation! We both get reputation!

Ad

Answer this question