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

2 comments
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)'.
so then how do I set it as true and false?