Hello, This isn’t really easy to explain, so i’ll do my best.
There is something wrong with the following function.
function GM:PlayerInitialSpawn( ply )
ply:SetNWInt( “Stamina”, 100 )
local cash = ply:GetPData("money") --if cash == nil then -- ply:SetPData("money", MONEY_STARTAMOUNT) -- ply:SetMoney( MONEY_STARTAMOUNT ) --else -- ply:SetMoney( cash ) --end
The lines that are commented out is where the problem seems to be
It sets a players money properly upon first spawn, but what I don’t understand is, when ever I go to buy a weapon from the weapon menu in my gamemode, this error pops up (This is for only 1 of the weapons):
gamemodes\bonkdm\gamemode\init.lua:183: attempt to compare string with number
And it does not let me buy weapons from the menu until I get at least 1 kill.
If I remove “if cash == nil then” and replace it with “if cash == 0 then”, people can access the weapons, but the money doesn’t load.
I’ve tried using files but I have no idea how to use the file read/load crap. It doesn’t like me.
Anyways, any ideas?