General > Developers Corner

Weapons at Spawn : Setup/etc

(1/1)

Rad:
How do you set up the starting weapons? I searched the forums but starting weapons did not return anything useful

I was able to find this link but I do not know how to set it up. I put that file (ulx_scripts.lua) in the gmod/addons/Ulib/lua/Ulib/modules directory, but the commands dont seem to work.

Plus, its not exactly what I was looking for, I want to change starting weapons not use commands to give players SWEPS

Not sure if this is where it should go, it doesnt really belong in Suggestions, or Bug Report heh... and I would think this would be a FAQ (Unless I just missed something obvious)

Chironex:
Take a look at:

Gamemode.PlayerSpawn
and
Player.Give

Then you can do something like that, very basically:

--- Code: ---local function GiveCrowbarOnSpawn( ply )
ply:Give( "weapon_crowbar" )
end

hook.Add( "PlayerSpawn", "GiveCrowbarOnSpawnFunc", GiveCrowbarOnSpawn )
--- End code ---

I'm also beginner so don't blame me if i'm wrong :P

Rad:
If I do this, where do I put the script? How do I remove the other weapons etc? I have never messed with lua (Other than changing some strings etc), but I have done some minor programming before

JamminR:
[Note] - Topic moved and renamed due to improper forum location and off-topic to thread posted question

Navigation

[0] Message Index

Go to full version