I feel like this has a very simple answer, but for some reason I can’t figure out how to change a number value in the Local Player’s Backpack. I made a simple script in a Click Detector, but it just won’t work. What am I doing wrong?
os.time()
script.Parent.MouseClick:Connect(function()
local num = math.random(1, 500)
game.Players.LocalPlayer.Backpack.TESTVALUE.Value = num
end)
I just tried it and no its not possible, the devhub page shows that it can only store “Tool” Instances, so just place your “TESTVALUE” somewhere else in the player and it’ll work!
Is this a Script or LocalScript? If it’s a Script, LocalPlayer is nil.
Also, backpack children get cleared every time a character loads, which may cause your value to be deleted when the player first loads their character in or reloads it.