I have this leaderstats script :
game.Players.PlayerAdded:connect(function(player) local leader = Instance.new("Folder",player) leader.Name = "leaderstats" local Points = Instance.new("IntValue",leader) Points.Name = "Points" Points.Value = 0 local Title = Instance.new("StringValue",leader) Title.Name = "Title" Title.Value = "Noob Finder" while true do wait(.6) if Points.Value > 100 then Title.Value = "Good Finder" end end end)
and i want to show the title value above players head. But I tried and it didn't work for other players and it didn't update. Please help me
Gui above head script:
game.Players.PlayerAdded:connect(onPlayerRespawned) function onPlayerRespawned(newPlayer) wait(1) if newPlayer then gui=Instance.new("BillboardGui") gui.Parent=newPlayer.Character.Head gui.Adornee=newPlayer.Character.Head gui.Size=UDim2.new(4,0,2,0) gui.StudsOffset=Vector3.new(0,3,0) texta=Instance.new("TextBox") texta.Size=UDim2.new(1,0,1,0) texta.TextSize = 35; texta.Font = 10; texta.TextStrokeTransparency = 1; texta.TextStrokeColor3 = Color3.new(0,0,0) texta.BackgroundTransparency = 1 texta.TextColor3 = Color3.new(255,255,255) texta.Parent=gui if newPlayer.leaderstats.Title.Value == 'Noob Finder' then texta.Text = "[Noob Finder]" texta.TextColor3 = Color3.new(255,0,0) end if newPlayer.leaderstats.Title.Value == 'Good Finder' then texta.Text = "[Good Finder]" texta.TextColor3 = Color3.new(255,255,0) end end end function onPlayerEntered(newPlayer) newPlayer.Changed:connect(function (property) if (property == "Character") then onPlayerRespawned(newPlayer) end end) end game.Players.PlayerAdded:connect(onPlayerEntered)
Basically just do this.
while true do yourgui.Text = onPlayerRespawned.PlayerGui.(location to the title).Value wait() end
this keeps updating the values because it's in a while loop Also change all 'connect' to 'Connect'. 'connect' is deprecated