Ello! For some reason i’m getting an error for the leaderstats which I can’t even read. It refuses to minus the value from the leaderstats.
Error:
Players.TheKman2019.PlayerGui.GunShopUI.Main.Guns.ITEM1.$INTERACTION.GiveGun:7: attempt to perform arithmetic (sub) on Instance and number - Server - GiveGun:7
Script:
local RS = game:GetService("ReplicatedStorage")
local WeaponLocation = RS.Weapons.R700 -- Change to add new gun
local Cost = script.Parent.Parent["$MONEY"]
script.Parent.OnGunBought.OnServerEvent:Connect(function(player)
player.leaderstats.Bank -= Cost.Value -- Error right here
WeaponLocation:Clone()
WeaponLocation.Parent = player.Backpack
print("Player has bought the "..WeaponLocation..".")
end)