How to make certain ULX ranks spawn with certain weapons

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?

So can I just use that code, but change rank and tool?
And what should the LUA file be called?

You can call the Lua file anything. It just has to be ran serverside (lua/autorun/server).

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.