Hello, so I'm trying to add last prop standing to my prop hunt server. Last prop standing is basically where the last prop on the map gets a gun and gets to kill the rest of the hunters. There is only 2 other servers that have this so finding it is near impossible. I have tried doing it myself and with another Ulysses post but I can't figure it out.
This is what I have so far:
in the init.lua file I have this on line 75:
// Called when player tries to pickup a weapon
function GM:PlayerCanPickupWeapon(pl, ent)
local prop_alive = {}
for k,pl in pairs( team.GetPlayers(TEAM_PROPS) ) do
if pl:Alive() then table.insert( prop_alive, pl ) end
end
if pl:Team() == TEAM_PROPS && table.Count(prop_alive) == 1 then
return true
end
if pl:Team() == TEAM_HUNTERS then
return true
end
return false
and this in the class_prop.lua
// Called by spawn and sets loadout
function CLASS:Loadout(pl)
--Last Prop Standing
pl.IsLastProp = true // Setting the variable for the player.
pl:Give("eg")
pl:CrosshairEnable()
end
So in testing the prop does not get the weapon eg and when I do the ULX give command, the prop cannot cause damage to the hunters.
I'm a little new to lua programming so any help will do.
Thank you!