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)

5 comments

0

What are you trying to change the color of?

0

Yes, what's script.Parent?

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

0

No reason to split it into multiple scripts. You need a while loop, combined with a simple if in conjunction with this event.

0

@BlueTaslem could you fix it please?