So i made a leaderstats script and a gui that shows your leaderstats value, but for some reason it dosent update and i dont know why, here is the leaderstats script
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local money = Instance.new("IntValue")
money.Name = "Cash"
money.Parent = leaderstats
money.Value = 0
local crops = Instance.new("IntValue")
crops.Name = "Crops"
crops.Parent = leaderstats
crops.Value = 100
local level = Instance.new("IntValue")
level.Name = "Level"
level.Parent = leaderstats
level.Value = 0
end)
and here is my gui script
local player = game:GetService("Players").LocalPlayer
local cash = player.leaderstats.Cash.Value
script.Parent.Text = math.floor(cash)
cash.Changed:Connect(function()
script.Parent.Text = math.floor(cash)
end)
