Thread: (Request) Lua request.
View Single Post
Old 04-02-2015, 04:50 PM   #2
R00Kie
Kawaii! ルーキー
Lua Team
Wiki Team
Fortress Forever Staff
 
R00Kie's Avatar
 
Join Date: Jan 2008
Location: Nowhere, Kansas
Class/Position: Random
Gametype: CTF
Affiliations: BiG, Kawaii!, MustacheBrigade, GoodFellas
Posts Rated Helpful 82 Times
Just fyi, the health tics down like the Medic over heal. You can increase the value of 1.25 if you want to start with more health. As far as the spawn points go I'm going to need more information about your map. You Can send me a PM when you get close to finishing.

Code:
function player_spawn( player )
	local player = CastToPlayer ( player )
	local MaxHealth = (player:GetMaxHealth() * 1.25) - player:GetMaxHealth()
	
	player:AddHealth(MaxHealth, true)
end

function player_killed( player, damageinfo )
	-- suicides have no damageinfo
	if not damageinfo then return end
	
	local player = CastToPlayer( player )
	local attacker_entity = damageinfo:GetAttacker()
	local attacker = CastToPlayer(attacker_entity)

	if not attacker then return end
	
	if IsPlayer( attacker ) then
		if player:GetId() ~= attacker:GetId() then
			local MaxHealth = (attacker:GetMaxHealth() * 1.25) - attacker:GetMaxHealth()
			
			attacker:ReloadClips()
			attacker:AddHealth(100, false)
			attacker:AddHealth(MaxHealth, true)
		end
	elseif IsSentrygun(attacker) then
	elseif IsDetpack(attacker) then
	elseif IsDispenser(attacker) then
	else
		return
	end	
end
__________________
Released: [ Island ] [ Rookie ] [ Limbo ] [ Sonic ] [ Tomb ] [ Skydive2 ] [ Bunkerwars ]
Beta: [ Argon ] [ Reflection ] [ Urbantag ]
Lua: [ game_rules ]

Last edited by R00Kie; 04-02-2015 at 04:55 PM.
R00Kie is offline   Reply With Quote


1 members found this post helpful.