• DarkRP Module won't do anything
    2 replies, posted
Hello, I'm an absolute Newbie to LUA but I know the basic things, how to use commands and classes etc. So, I tried to write a TINY DarkRP Module that would let people buy for their beloved props, determined by the bouncing radius ( whatever the hell this is ) . So, theres the module spawnmenu_mod.lua in DarkRP/gamemode/modules: [code] local function buyProp( ply, mdl ) local cost = math.floor( mdl:BoundingRadius( ) ) if (ply:CanAfford(cost)) then ply:AddMoney(-cost) AddNotify("You bought this prop for "+tostring(cost),NOTIFY_HINT, 8) return true else AddNotify("You can't afford this prop for "+tostring(cost),NOTIFY_ERROR, 8) return false end end hook.Add( "PlayerSpawnProp", "buyProp", buyProp ) [/code] Problem: It does absolutely nothing. Any ideas? Thanks for any help.
The concatenation operator is .. and not + in Lua. Also, any errors?
//EDIT: Solved the 2nd problem, just use SendLua ;) //EDIT2: FIXED ALL BUGS Thank you for reply
Sorry, you need to Log In to post a reply to this thread.