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
9 years ago

Why isn't this working?..

local function fun() --This is the disco part
while true do
script.Parent.Color = Color3.new(math.random(), math.random(), math.random())
wait(0.5)
end

function onChatted(msg, recipient, speaker) --Function for msg

local source = string.lower(speaker.Name) 
msg = string.lower(msg)

if (msg == "disco") then    --If noob101 says disco than disco is set to true
fun = true
end

end

local source = string.lower(speaker.Name) 
msg = string.lower(msg)


if (msg == "undisco") then --If noob101 says undisco than disco is set to false
fun = false
end
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 — 9y
0
so then how do I set it as true and false? Ulysies 50 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

You need to do instead of

fun = true

you need to do

fun() -- to start the function!

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

Ad

Answer this question