Unexpected error?

I’m trying to make it to where it costs the player money to spawn a prop.

Code:


function BuyProp( ply, model, ent )
	local current_buks = ply:GetBuks()
	if current_buks >= 10 then
	ply:SubtractBuks( 10 )
	else
	ent:Remove()
	end
end 

hook.Add( "PlayerSpawnedProp", "Buy Prop", BuyProp )

And I’m getting this error:

[editline]25th April 2016[/editline]

Nevermind; I had to use


local current_buks = tonumber(ply:GetNWInt("Buks")