I think it’s because of the FindFirstChild()? I’m just doing this how I’d do it, personally, as well as doing some features I think might be the problemo
local Player = game.Players.LocalPlayer
local LV = script.Parent:WaitForChild("LV")
local G = script.Parent:WaitForChild("G")
script.Parent:WaitForChild("Name").Text = " "... plr.Name
if (LV.Visible == false) then
LV.Visible = true
end
if (G.Visible == false) then
G.Visible = true
end
Players.leaderstats.LV:GetPropertyChangedSignal("Value"):Connect(function()
LV.Text = "LV ".. tostring(Player.leaderstats.LV.Value)
end)
Players.leaderstats.G:GetPropertyChangedSignal("Value"):Connect(function()
G.Text = "G ".. tostring(Player.leaderstats.G.Value)
end)
Still doesn’t seem to work… I think it may be cause of the leaderstats being a folder and not a model? but I dont think thats the cause as if I do while wait() do it works but I currently don’t want to do that is its inefficient
It shouldn’t be because it’s in a folder, that’s what it usually should be in, to make things easier, but it doesn’t really affect anything.
Try using Instance.Changed it should help out because you should be able to do
local Player = game.Players.LocalPlayer
local LV = script.Parent:WaitForChild("LV")
local G = script.Parent:WaitForChild("G")
script.Parent:WaitForChild("Name").Text = " "... plr.Name
if (LV.Visible == false) then
LV.Visible = true
end
if (G.Visible == false) then
G.Visible = true
end
Players.leaderstats.LV.Changed:Connect(function(typeof_)
if typeof_ == "Value" then
LV.Text = "LV ".. tostring(Player.leaderstats.LV.Value)
end
end)
Players.leaderstats.G.Changed:Connect(function(typeof_)
if typeof_ == "Value" then
G.Text = "G ".. tostring(Player.leaderstats.G.Value)
end
end)
local players = game:GetService("Players")
local player = players.LocalPlayer
local leaderstats = player:WaitForChild("leaderstats")
local stat1 = leaderstats:WaitForChild("LV")
local stat2 = leaderstats:WaitForChild("G")
local frame = script.Parent
local lv = frame:WaitForChild("LV")
local g = frame:WaitForChild("G")
local name = frame:WaitForChild("Name")
name.Text = player.Name
stat1.Changed:Connect(function(newlv)
lv.Text = newlv
end)
stat2.Changed:Connect(function(newg)
g.Text = newg
end)
That’s not how the “.Changed” event works for ValueBase instances (IntValue, StringValue, BoolValue etc.), its parameter doesn’t represent the name of the changed property like “.Changed” does for other instances, its parameter represents the value property’s new value (which resulted in the event firing).