so i did script but when i die gui text doesn’t change i tried somethings like Player.CharacterAdded:Wait() or
Player.CharacterAdded event but Player.CharacterAdded:Wait() dont do anything and Player.CharacterAdded event just changing when player joined the game i wanna change gui text when i change team and keep that text when i die and respawn
this is ServerSide Script:
--- Hello! My name is fish500m. Scripter
-- ROKA Group : https://www.roblox.com/My/Groups.aspx?gid=3828960
-- Korea Developers : https://www.roblox.com/My/Groups.aspx?gid=4093314
-- Thanks for using :D Enjoy!
-- Do not change.
--- Copyright
-- Made : bluejtt2017
-- Edit : fish500m
--
---
local MainGroup = 11368873
local User = script:WaitForChild("Username")
local Rank = script:WaitForChild("Rank")
local Regiment = script:WaitForChild("Regiment")
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
spawn(function()
wait(2.5)
local c = User:clone()
local a = Rank:clone()
local b = Regiment:clone()
a.Adornee = Character:WaitForChild("Head")
a.TextLabel.Text = Player:GetRoleInGroup(MainGroup)
a.Enabled = true
a.Parent = Character
b.Adornee = Character:WaitForChild("Head")
b.TextLabel.Text = Player.Team.Name
b.TextLabel.TextColor3 = (Player.TeamColor.Color)
b.Enabled = true
b.Parent = Character
c.Adornee = Character:WaitForChild("Head")
c.TextLabel.TextColor3 = (Player.TeamColor.Color)
c.TextLabel.Text = Player.Name
c.Enabled = true
c.Parent = Character
Character:WaitForChild('Humanoid').NameOcclusion = Enum.NameOcclusion.OccludeAll
local h = Character.Head:Clone()
local m = Instance.new('Model',Character)
m.Name = 'NameTag'
h.Parent = m
Character.Head:WaitForChild('face'):Destroy()
Character.Head.Transparency = 1
local w = Instance.new('Weld',Character.Head)
w.Part0, w.Part1 = Character.Head, h
return b.TextLabel.Text == Player.Team.Name
end)
end)
end)
this is local script:
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Frame = Character:WaitForChild("Regiment").TextLabel
local runservice = game:GetService("RunService")
runservice.Heartbeat:Connect(function()
Frame.Text = Player.Team.Name
Frame.TextColor3 = Player.TeamColor.Color
end)