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

Whats wrong with my disco script?

Asked by
Ulysies 50
9 years ago

Whats wrong with this? I've re-written this 4 times and it still doesn't work.. Can somebody help?

local group = {
    ["WildLasVegas"] = true;
    ["Senias"] = true;
}

game.Players.PlayerAdded:connect(function(player)
    if group[player.Name] then 
        player.Chatted:connect(function(msg)

            if (msg == "disco") then    
    script.Parent.Color = Color3.new(math.random(), math.random(), math.random())
wait(0.5)


            end          
        end)
    end
end)

0
What are you trying to change the color of? Discern 1007 — 9y
0
Yes, what's script.Parent? Redbullusa 1580 — 9y
0
My recommendation for this is to have 2 separate scripts (not including this one). A DiscoOn and DiscoOff, each being while loops to, well, the name is self explanatory. They are enabled/disabled by this script Shawnyg 4330 — 9y
0
No reason to split it into multiple scripts. You need a while loop, combined with a simple `if` in conjunction with this event. BlueTaslem 18071 — 9y
0
@BlueTaslem could you fix it please? Ulysies 50 — 9y

Answer this question