Error that i cant fix

I get this error, anyone can help?



Hook 'CreditNote' Failed: [gamemodes\mygamemode\gamemode\init.lua:117] attempt to perform arithmetic on a boolean value

the line is:

[lua]killer:SetPData(“money”, killer:GetPData(“money”) + 10 )[/lua]

the pdata starts like this:

[lua]function GM:PlayerInitialSpawn( ply )
if ply:GetPData(“money”) == 0 or nil then
ply:SetPData(“money”, 0)
end
end[/lua]

Anyone know why its coming out as a boolean and not a number?

[editline]25th February 2011[/editline]

also when i run the command to print my cash i get this



[gamemodes\mygamemode\gamemode\init.lua:125] attempt to concatenate a boolean value


Running the risk of sounding dumb, why are you making money become 0 if it already is 0?

I’d use
[lua]
function GM:PlayerInitialSpawn( ply )
if !(ply:GetPData(“money”)) then
ply:SetPData(“money”, 0)
end
end
[/lua]

Don’t I have to create the pdata?

Also its cause I’m going to make a menu pop up if its their first time joinimg

Correct, you do have to create the pdata, but in your original code you ran a check to see if the player had 0 money, and if they did set their money to 0. And to make a menu pop up, just put in the menu code right under the SetPData.

I fixed it.

Its cause “money” was already used in my sv.db.

Removed it and cleared it, all is good now.