Garry's Mod

Garry's Mod

Battle Royale
This topic has been locked
Eliwynn 22 Mar, 2017 @ 3:09pm
Can we randomize the weapons ?
If someone know how to randomize weapons it will be great.
I'm lazy after 5 games to see the guns are always the same in the same place....
So the strat will be to aim landing at one point to find our favorite weapon and begin killing ppl..
Please I want an answer :)
Last edited by Eliwynn; 22 Mar, 2017 @ 3:10pm
< >
Showing 1-2 of 2 comments
murray  [developer] 22 Apr, 2017 @ 12:41pm 
Yes, opening shared.lua you can edit the weapon drop on LootSpawn() function. You can change the weapons on the same function of the drop changing.
Example:

local M4A1 = ents.Create( "weapon_m4a1" ) #weapon entity
if ( !IsValid( M4A1 ) ) then return end
M4A1:SetPos( Vector( 13826, 12370, -7000 ) ) # position
M4A1:Spawn()

#weapon entiy: you will change this line for the your workshop weapon entity name.
#position: changing the vector = changing the weapon spawn position, you can make it random making a table and using math.random function too.

Example to make it random:

Put this code in the beginning of LootSpawn() function

weapon_positon = { Vector( 13826, 12370, -7000 ), Vector( 4232, 2342, -7000 )}

then change M4A1:SetPos( Vector( 13826, 12370, -7000 ) ) to
M4A1:SetPos( table.random(weapon_position) )

Of course, put more vectors on the weapon_position table.
murray  [developer] 28 Jul, 2017 @ 1:47pm 
random weapons on spawn added on patch 21 [0.3a]
< >
Showing 1-2 of 2 comments
Per page: 1530 50