#so.. i have this store and everything works fine until of course it says
LocalScript:11: attempt to compare number with userdata
yeah.. anyways they are both int values, but why can i not compare them?
edit: forgot to put the line that makes this error
if points >= 500 then
edit: full function here
wait(5.5)
Tool = false
local player = game.Players.LocalPlayer
points = player.leaderstats.Coins
local product = ".300 Carbine"
local prodlocation = game.ReplicatedStorage.NewWeaponStache.Carbines -- reminder to self: change this later
-----------------------------------------------------------------------------------------
function activate()
if points >= 500 then
if Tool== false then
prodlocation:Clone().Parent = player.Backpack
prodlocation:Clone().Parent = player.StarterGear
points = points - 500
Tool = true
end
elseif Tool == true then
local tool = player.Backpack:GetChildren()
if Tool and Tool ~= product then
Tool:Destroy()
Tool = false
prodlocation:Clone().Parent = player.Backpack
prodlocation:Clone().Parent = player.StarterGear
points = points - 500
Tool = true
end
end
end

3 comments
This should work, can you show the rest of the code?
If points is actually an object in the player's leaderstats or something, you will have to do points.Value
@hitonmymetatables alright ill show it