In this script, we add a chat command that creates cash from nothing. Otherwise, all players will see the chatcommand and arguments in their chat boxes! When using DarkRP chat commands, you must return a empty string. Trace.endpos = trace.start + ply:GetAimVector ( ) * 85Īnd finally, we create the money using the trace information:ĭarkRPCreateMoneyBag (tr.HitPos, amount ) Next, we create a trace object of where the playing is looking at. Currently includes: Auto-bind T to toggle thirdperson, only allow admins to spawn props. Ply:ChatPrint ( "You are not authorized to use this chat command!" ) return end This folder includes small scripts which are not worthy of its own addon. Notify (ply, 1, 4, string.format (LANGUAGE.invalid_x, "argument", "" ) ) return "" end if ply:IsSuperAdmin ( ) then Local amount = math.floor ( tonumber (args ) ) if amount <= 1 then Next, we check if the value they are trying to create is lower than 1, or if the player that is trying to create cash, is not a superadmin. Warning: If this file is missing settings (because of e.g. Dark RP is a mod for a gmod that lets you roleplay, not like the normal role playing trying to be more 'lifelike' it tends to break the rules a little bit more. Local function CreateCash (ply, args ) if args = "" then return "" end if not tonumber (args ) then return "" end local amount = math.floor ( tonumber (args ) ) if amount DarkRP config settings.-This is the settings file of DarkRP. It should work just the same, but the work wont get lost at updates.Īdd the following code to the bottom of a: You could also paste this in a new lua file in gamemodes/modules. In this tutorial we will be using the default DarkRP a file! I will be showing you how to add a new chat command that creates money from nothing! then the next time youre in game press key next to 1. Welcome to the tutorial, in this tutorial. load Garrys Mod ->Go into Options -> Click on Advanced -> Enable Console panel.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |