I am trying to make titles so people can know who u are in game (e.g: Owner, Tester,Developer) and when i play test it gives an error. It says "Expected end to close function in line 3" here is the script (hope you can help :D)
local billboardgui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character) end) if player.Name == "Ewiq44" then local clonedgui = billboardgui:Clone() clonedgui.TextLabel.Text = "Owner" clonedgui.TextLabel.TextColor3 = Color3.fromRGB(254,162,82) clonedgui.Parent = game.Workspace:WaitForChild(player.name).Head end if player.Name == "not gonna show the username on this post" then local clonedgui = billboardgui:Clone() clonedgui.TextLabel.Text = "Tester" clonedgui.TextLabel.TextColor3 = Color3.fromRGB(163,0,153) clonedgui.Parent = game.Workspace:WaitForChild(player.name).Head
end
That error means that you forgot an “end)” for your function. The simple solution is to put another “end)” one line before your last “end”. Also make sure your ends have a “)” since it’s an event.
player.CharacterAdded:Connect(function(character) end) if player.Name == "Ewiq44" then local clonedgui = billboardgui:Clone() clonedgui.TextLabel.Text = "Owner" clonedgui.TextLabel.TextColor3 = Color3.fromRGB(254,162,82) clonedgui.Parent = game.Workspace:WaitForChild(player.name).Head end if player.Name == "not gonna show the username on this post" then local clonedgui = billboardgui:Clone() clonedgui.TextLabel.Text = "Tester" clonedgui.TextLabel.TextColor3 = Color3.fromRGB(163,0,153) clonedgui.Parent = game.Workspace:WaitForChild(player.name).Head end end
or
player.CharacterAdded:Connect(function(character) end) if player.Name == "Ewiq44" then local clonedgui = billboardgui:Clone() clonedgui.TextLabel.Text = "Owner" clonedgui.TextLabel.TextColor3 = Color3.fromRGB(254,162,82) clonedgui.Parent = game.Workspace:WaitForChild(player.name).Head end if player.Name == "not gonna show the username on this post" then local clonedgui = billboardgui:Clone() clonedgui.TextLabel.Text = "Tester" clonedgui.TextLabel.TextColor3 = Color3.fromRGB(163,0,153) clonedgui.Parent = game.Workspace:WaitForChild(player.name).Head end
i dont know how many ends you need, but one of these should work! i hope this works...