Hello, I have problem with points leaderboard gui, after death my gui show me 0, but still got all points. Here is main script from workspace:
game.Players.PlayerAdded:connect(function(player) local leaderstats = Instance.new("IntValue",player) leaderstats.Name = "leaderstats" local points = Instance.new("NumberValue",leaderstats) points.Name = "Points" points.Value = 0 local P = game.StarterGui.Points.Frame.Point P.Text = " "..points.Value end)
Here is script from StarterGUI>Points>Frame>Point :
local Player = game.Players.LocalPlayer local stats = Player:WaitForChild("leaderstats") local points = stats:WaitForChild("Points") function PointChange() script.Parent.Text = " "..points.Value end points.Changed:connect(PointChange)
Maybe i need add line somewhere, but i don't know where, becouse im beginner scripter. Here is GIF with my problem: http://gyazo.com/c99252551e5a5bf76dee3c3b0829b9a6
local Player = game.Players.LocalPlayer local stats = Player:WaitForChild("leaderstats") local points = stats:WaitForChild("Points") script.Parent.Text = " "..points.Value -- Every time a player dies, the startergui is re-added to their playergui. Therefore, if this is added, when it is re-added to their playergui, it will display their current points instead of 0. function PointChange() script.Parent.Text = " "..points.Value end points.Changed:connect(PointChange)