local db = true script.Parent.Touched:Connect(function(limb) if not db then return end db = false --check for humanoid if limb.Parent.Humanoid then print("Heart Found!") local plr = game:GetService("Players"):FindFirstChild(limb.Parent.Name) --if its a player if plr then local coins = plr.leaderstats.Coins local bag = plr.otherStats.Bag local values = {coins.Value, bag.Value} print(values[1], values[2]) -- here it says bag value is 0, its not? if values[2] >= 1 then coins.Value = values[1] + values[2] print(coins.Value) end end end wait(3) db = true end)
Whenever i step on the sell button it says the bag has 0 when the actual value has 3 or any number. Why is this?
How its stored?
local Tool = script.Parent; local biteVal = 1 enabled = true script.Parent.Activated:Connect(function() if not enabled then return end enabled = false local plr = game.Players.LocalPlayer local bites = plr.leaderstats.Bites if plr.otherStats.Bag.Value < plr.otherStats["Bag Capacity"].Value then Tool.GripForward = Vector3.new(-0.018, -0.307, -0.952) Tool.GripPos = Vector3.new(1.488, -0.36, -0.573) Tool.GripRight = Vector3.new(1, -0.02, -0.013) Tool.GripUp = Vector3.new(0.016, 0.952, -0.307) wait(.5) bites.Value = bites.Value + biteVal plr.otherStats.Bag.Value = plr.otherStats.Bag.Value + biteVal Tool.Handle.EatSound:Play() Tool.GripForward = Vector3.new(0, 0.167, -0.986) Tool.GripPos = Vector3.new(0.053, -0.099, 0.07) Tool.GripRight = Vector3.new(0.989, -0.149, -0.025) Tool.GripUp = Vector3.new(0.151, 0.975, 0.165) enabled = true else enabled = true end end)