• Print

Author Topic: Last Prop Standing  (Read 4176 times)

0 Members and 1 Guest are viewing this topic.

Offline DJX

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Last Prop Standing
« on: October 20, 2015, 06:40:21 pm »
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:
Code: Lua
  1. // Called when player tries to pickup a weapon
  2. function GM:PlayerCanPickupWeapon(pl, ent)
  3. local prop_alive = {}
  4. for k,pl in pairs( team.GetPlayers(TEAM_PROPS) ) do
  5. if pl:Alive() then table.insert( prop_alive, pl ) end
  6. end
  7. if pl:Team() == TEAM_PROPS && table.Count(prop_alive) == 1 then
  8. return true
  9. end
  10.  
  11. if pl:Team() == TEAM_HUNTERS then
  12. return true
  13. end
  14.  
  15. return false

and this in the class_prop.lua

Code: Lua
  1. // Called by spawn and sets loadout
  2. function CLASS:Loadout(pl)
  3.        
  4. --Last Prop Standing
  5. pl.IsLastProp = true // Setting the variable for the player.
  6. pl:Give("eg")
  7. pl:CrosshairEnable()
  8. 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!

Offline dralga

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: Last Prop Standing
« Reply #1 on: October 20, 2015, 08:01:49 pm »
My server is one of the two servers with a last prop standing function. I have the code however i didnt code it so it isnt mine to release. The co-owner made it from scratch

Offline DJX

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Last Prop Standing
« Reply #2 on: October 21, 2015, 06:23:56 am »
Oh hi Dralga! I play on chillztown all the time! Don't know if you recognized my user name  :)

  • Print