All pastes #266157 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-12-03 21:42 UTC
rendered paste body
--Bughunt script
--HellSpawn
--11.29.06
--- [[ Global Variables ]] ----------
 
g_arena = nil      -- The global arena class, to avoid having to pass it around functions
g_bGameRunning = false  -- Is the game running?

--g_winner = nil    -- The player who won --- no use for this at the moment
--g_state = nil      -- The global GameState class --- no use for this at the moment


--- [[ Functions ]] -------

-- when the arena is created, it runs this
function Arena_OnCreate(arena)        
    g_arena = arena        
    math.randomseed(os.time())
end

-- when a player kills another player drop some gold for the killer
function Player_OnDeath(killer, victim)
	local pos = victim:coords()
                g_arena:item_create("Body Parts", 2, pos.x, pos.y)
end
--Lets See if the sergeant picked up a flag
function Item_OnPickUp(looter, loot, loot_type, amounttopickup)
end

elseif (loot_type.m_name == "Science Object A") then
                -- Dont't let skrall or any other class besides sergeant pick it up
	if (looter:getVehicle():vehicletypeid() >= 200) then
	    looter:message("You can't eat the science objects!")	
	if (looter:getVehicle():vehicletypeid() == 104) then
	    looter:message("Only the Sergeant may capture the Science objects!")		
	if (looter:getVehicle():vehicletypeid() == 100) then
	    looter:message("Only the Sergeant may capture the Science objects!")		
	if (looter:getVehicle():vehicletypeid() == 102) then
	    looter:message("Only the Sergeant may capture the Science objects!")		
	if (looter:getVehicle():vehicletypeid() == 103) then
	    looter:message("Only the Sergeant may capture the Science objects!")		
	return false
       end
end

	
	
-- when a player enters the zone, it gives them this message
function Player_OnJoin(player)
    player:message("&Note: Welcome to Bughunt. Report any bugs or suggestions on the forums!")
end

-- when the game starts, it sets gameRunning to true
function Arena_OnGameStart()
	g_bGameRunning = true
end

-- when the game finishes, it sets gameRunning to false
function Arena_OnGameEnd()
	g_bGameRunning = false
end