How would I remove money from a player if he runs a command? (Sorry for such a rubbish question, trying to learn lua)
[lua]
function TakeMoney( Player )
if Player (does bla bla) then
Player:AddMoney(-500)
end
[/lua]
That is all I can figure out w/o asking for help
This is using DarkRP? If so it would look something like this
[lua]function TakeMoney( ply )
ply:AddMoney(-amount)
end
concommand.Add("money", TakeMoney)[/lua]
But could I ask what this is for?
[QUOTE=Extazy;22582479]How would I remove money from a player if he runs a command? (Sorry for such a rubbish question, trying to learn lua)
[PHP]function TakeMoney( Player )
if Player (does bla bla) then
Player:AddMoney(-500)
end[/PHP]That is all I can figure out w/o asking for help[/QUOTE]
[PHP]function TakeMoney( Player )
if Player (does bla bla) then
Player:SetMoney(Player:GetMoney() - 500)
end
end[/PHP]
Maybe like this, but i dont know i am new to lua too
[QUOTE=StandaxXx;22582856][PHP]function TakeMoney( Player )
if Player (does bla bla) then
Player:SetMoney(Player:GetMoney() - 500)
end
end[/PHP]
Maybe like this, but i dont know i am new to lua too[/QUOTE]
No.
[QUOTE=sintwin;22582809]This is using DarkRP? If so it would look something like this
[lua]function TakeMoney( ply )
ply:AddMoney(-amount)
end
concommand.Add("money", TakeMoney)[/lua]
But could I ask what this is for?[/QUOTE]
Okay. That is part of the META table.
The question is, how would I implement a console command into the function. The code is all done, I just don't know how to implent the "if, then" statement with it calling a command
Sorry, you need to Log In to post a reply to this thread.