I am making voting system, but when I change the color of the vote pad it does not change to the right color when I step on another pad.
Video
robloxapp-20200918-1220491.wmv (2.2 MB)
Local Script
RS.Events.MapVotingEvent1.OnClientEvent:Connect(function()
if mapVotingParts.VoteMapPad1.Color == Color3.fromRGB(163, 162, 165) then
if mapVotingParts.VoteMapPad2.Color == Color3.fromRGB(163, 162, 165) then
mapVotingParts.VoteMapPad1.Color = Color3.fromRGB(75, 151, 75)
RS.Events.MapVotingEvent1:FireServer()
else
mapVotingParts.VoteMapPad1.Color = Color3.new(75, 151, 75)
mapVotingParts.VoteMapPad2.Color = Color3.new(163, 162, 165)
RS.Events.ReMapVotingEvent1:FireServer()
end
end
end)
RS.Events.MapVotingEvent2.OnClientEvent:Connect(function()
if mapVotingParts.VoteMapPad2.Color == Color3.fromRGB(163, 162, 165) then
if mapVotingParts.VoteMapPad1.Color == Color3.fromRGB(163, 162, 165) then
mapVotingParts.VoteMapPad2.Color = Color3.fromRGB(75, 151, 75)
RS.Events.MapVotingEvent2:FireServer()
else
mapVotingParts.VoteMapPad2.Color = Color3.new(75, 151, 75)
mapVotingParts.VoteMapPad1.Color = Color3.new(163, 162, 165)
RS.Events.ReMapVotingEvent2:FireServer()
end
end
end)