So, I created an Overhead GUI, and when I respawn it gets removed. I would like it to be there once and always.
ServerScript:
local mS = game:GetService("MarketplaceService")
local gmId = 8004097
game.Players.PlayerAdded:Connect(function(player)
local ohGUI = game:GetService("ServerStorage"):WaitForChild("OverheadGUI"):Clone()
local char = player.Character or player.CharacterAdded:Wait()
if char then
ohGUI.Parent = char.Head
local gM = ohGUI.Holder.GoldMember
local m = ohGUI.Holder.Moderator
local pN = ohGUI.Holder.PlayerName
while wait() do
pN.Text = player.Name
if player.TeamColor == game:GetService("Teams"):FindFirstChild("Moderation").TeamColor then
m.TextTransparency = 0.2
else
m.TextTransparency = 1
end
if mS:UserOwnsGamePassAsync(player.UserId,gmId) == true then
gM.TextTransparency = 0.2
else
gM.TextTransparency = 1
end
end
end
end)
Everything works fine, it just disappears after respawning.
What happens: https://gyazo.com/b5971322854ccfb07c6f74b6140a9552

3 comments
Thank you
It worked, I added player.CharactedAdded:Connect(function(char) under the main script and it works now. Thanks!
^^ You're welcome! Have fun scripting!