Hello! Me and my friend were making a script for a part to change colour when a custom word is said. We came up with this and does not work. How could we fix this? The part(s) is a gem on a gauntlet - like the infinity gauntlet however different colours and the gems are supposed to be swapping colours. If you can assist us with this, it'd be very appreciated.
admins = {"Starlighxt","pompintrere"}
function isAdmin(name)
for i,v in pairs(admins) do
if name:lower() == v:lower() then return true end
end
return false
end
game.Players.PlayerAdded:connect(function(p)
if isAdmin(p.Name) then
p.Chatted:connect(function(msg)
if msg=="change" then
local peep = workspace:FindFirstChild(p.Name)
local Gauntlet = peep:WaitForChild("Gauntlet")
for i, v in pairs(Gauntlet:GetChildren()) do
if v.Name == "Gaun" then
v.Color = Color3.fromRGB(0,255,0)
end
end
wait(5)
for i, v in pairs(Gauntlet:GetChildren()) do
if v.Name == "Gem" then
v.Color = Color3.fromRGB(0,0,0)
end
end
end
end)
end
end)
