local BackPack = script.Parent.BackPack
local Player = game.Players.LocalPlayer
local Wheat = Player.leaderstats.Wheat
local Storage = script.Parent.Storage.Value
local Storage = "25"
BackPack.Text = Player.leaderstats.Wheat.Value.."/"..Storage
if Wheat.Value == Storage then return end
✓ ANSWER ACCEPTED
Im trying to make a backpack script but Wheat does not seem to increase in value on the textlabel?
1 answer
✓ Accepted answer
This is because you have only set the textlabel once in the script meaning it would only run once. If you want it to change: use the Changed event like this:
local BackPack = script.Parent.BackPack
local Player = game.Players.LocalPlayer
local Wheat = Player.leaderstats.Wheat
local Storage = script.Parent.Storage.Value
local Storage = "25"
BackPack.Text = Player.leaderstats.Wheat.Value.."/"..Storage
Wheat.Changed:Connect(function() -- when wheat changes it will fire this function
BackPack.Text = Player.leaderstats.Wheat.Value.."/"..Storage
end)
if Wheat.Value == Storage then return end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thank you very much!