So when a player joins it should see if his name is in admin list then then gui should be visible for them.... Server Script(below)
local admins = {"dogovpain","Robin9370","meghrajiscool"} game.Players.PlayerAdded:Connect(function(plr) for i = 1,#admins do if plr.Name == i then game.ReplicatedStorage.Events.TeamChange:FireAllClients() end end end)
Local Script
local event = game.ReplicatedStorage.Events.TeamChange event.OnClientEvent:Connect(function() game.Players.LocalPlayer.PlayerGui:WaitForChild("SpawnTeam").AdminButton.Visible = true end)
Not that good with Fireclient
:FireAllClients()
fires to all clients. Try this:
local admins = {"dogovpain","Robin9370","meghrajiscool"} game.Players.PlayerAdded:Connect(function(plr) for i = 1,#admins do if plr.Name == admins[i] then game.ReplicatedStorage.Events.TeamChange:FireClient(plr) end end end)