I've been trying to make certain bricks change colour when a specific player joins, but else on line 23 is always causing an error because it's expecting an end to close do, but got else and I don't know the solution to it. Not even my goto solution of spamming ends worked.
local playerx = {"cpexo, cpoxo"}
local function Transparency()
for i,v in pairs(workspace:GetChildren()) do
if v.Name == "Part1" then do
v.Transparency = 0.5
end
end
end
end
local function ColorChange()
for i,v in pairs(workspace:GetChildren()) do
if v.Name == "Part1" then do
v.BrickColor = BrickColor.new("Really Red")
end
end
end
end
game.Players.PlayerAdded:Conenct(function(Player)
if table.find(playerx, Player.Name) then do
Transparency() else do
ColorChange()
end
end
end

1 comment
are you sure you need so many 'do's? have you tried it without them? also every do needs its own end