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
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!