• How to make certain ULX ranks spawn with certain weapons
    5 replies, posted
I want to make my gamemaster and staff members spawn with physgun and tool gun but I dont see a setting anywhere and I dont see any other threads that are helpful. Anyone know how I can set this? (Using ULX) I have tried multiple people telling me to use ply:Give(weapon_physcannon") but I dont know where to put that or how to set it for ranks. If anyone knows HOW to do that can they please reply? All help appreciated Currently I have this code in /lua/autorun/server/weapons.lua DarkRP.Add("PlayerSpawn","givevipweapons",function(ply) if ply:IsUserGroup("gamemaster") ply:IsUserGroup("moderator") or ply:IsUserGroup("admin") or ply:IsUserGroup("doubleadmin") or ply:IsUserGroup("superadmin") or ply:IsUserGroup("council") or ply:IsUserGroup("sudo-root") or ply:IsUserGroup("root") then ply:Give("weapon_physgun") end end) DarkRP.Add("PlayerSpawn","givevipweapons",function(ply) if ply:IsUserGroup("gamemaster") ply:IsUserGroup("moderator") or ply:IsUserGroup("admin") or ply:IsUserGroup("doubleadmin") or ply:IsUserGroup("superadmin") or ply:IsUserGroup("council") or ply:IsUserGroup("sudo-root") or ply:IsUserGroup("root") then ply:Give("gmod_tool") end end)
Please use [lua] tags. On another note why not just hook.Add? [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply) if (ply:IsUserGroup('gameMaster')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') end end)[/lua] Rough idea, but you get the point right?
[QUOTE=Nookyava;52767793]Please use [lua] tags. On another note why not just hook.Add? [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply) if (ply:IsUserGroup('gameMaster')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') end end)[/lua] Rough idea, but you get the point right?[/QUOTE] So can I just use that code, but change rank and tool? And what should the LUA file be called?
[QUOTE=admiralmirage;52767906]So can I just use that code, but change rank and tool? And what should the LUA file be called?[/QUOTE] You can call the Lua file anything. It just has to be ran serverside (lua/autorun/server).
[QUOTE=admiralmirage;52767906]So can I just use that code, but change rank and tool? And what should the LUA file be called?[/QUOTE] Yeah you can use that and put in the ranks/weapons you want. You can call it whatever you like, just make sure it's unique (no other files with the same name) and in the lua/autorun folder.
I know this is a 2 year old post but i got the same issue i tried the code and it did not work i have a feeling i did it very wrong though [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('trial moderator')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('moderator')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('senior moderator')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('administrator')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('senior administrator')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('assistant head of staff')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('head of staff')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('trial event planner')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('event planner')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('senior event planner')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('assistant head event planner')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('head event planner')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('builder')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('developer')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend) [lua]hook.Add('PlayerSpawn', 'darkrp_giveuserweapon', function(ply)if (ply:IsUserGroup('superadmin')) then ply:Give('weapon_physgun') ply:Give('gmod_tool') endend)
Sorry, you need to Log In to post a reply to this thread.