its me again was wondering if you could help

i am trying to use this simple money mod and was wondering if i can make a timer/command to make the money go up if you could be kind this time :slight_smile:


(User was banned for this post ("Undescriptive thread title" - mahalis))

[lua]
function money( ply )
ply:SetNWInt(“Money”, ply:GetNWInt(“Money”) + 200)
ply:PrintMessage(HUD_PRINTTALK, “You earned: 200”)
end
timer.Create(“moneyup”, 300, 0, money, ply)
[/lua]

[lua]
function money(ply,cmd,args)
if !ply:IsAdmin() then return end
ply:SetNWInt(“Money”, ply:GetNWInt(“Money”) + args[1])
PrintMessage(HUD_PRINTTALK, ply:Nick()…" Got money "…args[1])
end
concommand.Add(“AddMoney”, money)
[/lua]

i have managed to chage ur code to suit but it keeps reseting to 100 my default setting

Your code has to be serverside.

ty guys is there any way to make an ent auto spawn to a location from server start and respan every 10minutes or so

[lua]
function money(ply,cmd,args)
if !ply:IsAdmin() then return end
ply:SetNWInt(“Money”, ply:GetNWInt(“Money”) + args[1])
PrintMessage(HUD_PRINTTALK, ply:Nick()…" Got money "…args[1])
end
concommand.Add(“AddMoney”, money)
[/lua]

AddMoney 500

It gives you the money.

can any one tell me whats wrong with this code [lua] surface.SetTextPos( length + spacer, 5 )
surface.DrawText( "Money: " …money, “Tw Cen MT” )
local x, y = surface.GetTextSize( "Money: " ) …tostring(LocalPlayer():GetMoney())
moneypos = ( length + spacer + (x / 2) )
length = length + x + spacer
[/lua]

line 44 is local x, y = surface.GetTextSize( "Money: " ) …tostring(LocalPlayer():GetMoney())
masave error spam

You’re concatenating… nothing…

[lua]local x, y = surface.GetTextSize( "Money: " …tostring(LocalPlayer():GetMoney()) [/lua]

i was wondering how do u get an auto spawner to spawn ents or make the ent spawn more of its self near it

**[Timer.Create

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Timer.Create)**

is there any way to make an ent auto spawn say anasteriod and the yh a timer to respawn it but how would i do that sort of thing

Example.
[lua]
hook.Add(“InitPostEntity”,“Dotheconga”, function()
timer.Create(“PlOx”, 0.1, 0, function()
local entx = ents.Create(“prop_physics”)
entx:SetModel(“model/error.mdl”)
entx:SetPos(Vector(0,0,0.01))
entx:Spawn()
end)
end)
[/lua]