I am now using this code...
-- ULX Zombify for ULX SVN/ULib SVN by HeLLFox_15 with assistance from MrPresident, Megiddo, and JamminR
-- Organized by MrPresident
function Spawnzomb( pl, pos, ang, ztime )
R = { "npc_fastzombie", "npc_zombie", "npc_zombie_torso", "npc_zombine", "npc_fastzombie_torso" }
pl.zomb = ents.Create( R[math.random(1,5)] )
pl.zomb:SetAngles( ang )
pl.zomb:SetPos( pos )
pl.zomb:Spawn()
pl.zomb:Activate()
pl.zomb:SetNPCState(3)
pl.zomb:CallOnRemove( DespawnZomb, pl, pl.zomb)
pl:Spectate( OBS_MODE_IN_EYE )
pl:SpectateEntity( pl.zomb )
if not ( pl.zomb ) then DespawnZomb( pl, pl.zomb ) end
if ( pl.zomb ) then
timer.Create( "zombRemove_"..CurTime(), ztime, 1, DespawnZomb, pl, pl.zomb )
end
end
function DespawnZomb( pl, zomb )
if zomb then
zomb:Remove()
end
pl:UnSpectate()
pl:Freeze( false )
pl:Spawn()
end
function ulx.zombify( calling_ply, target_ply, ztime )
for _,pl in pairs( target_ply ) do
local pos = pl:GetPos()
local ang = pl:GetAngles()
local Effect = EffectData()
Effect:SetOrigin(pos)
Effect:SetStart(pos)
Effect:SetMagnitude(512)
Effect:SetScale(128)
util.Effect("cball_explode", Effect)
pl:EmitSound( "ambient/creatures/town_zombie_call1.wav", 100, 100 )
pl:StripWeapons()
Spawnzomb( pl, pos, ang, ztime )
end
ulx.fancyLogAdmin( calling_ply, "#A zombified #T for #s seconds", target_ply, ztime )
end
local zombify = ulx.command( "Fun", "ulx zombify", ulx.zombify, "!zombify" )
zombify:addParam{ type=ULib.cmds.PlayersArg }
zombify:addParam{ type=ULib.cmds.NumArg, hint="ztime", min=10, max=60, default=10, ULib.cmds.optional }
zombify:defaultAccess( ULib.ACCESS_SUPERADMIN )
zombify:help( "Turn a players into zombies." )
(You can see that I have made changes to get if the zombie is alive or not, and that I have added a for loop.)
...and I am now getting yet another error (This one made me LOL)...
*******************************************************
Error calling die function: 02647B38 for entity [NPC 316/npc_zombine]
ERROR: attempt to call userdata value
*******************************************************
And if you where foundering why I was gone for so long it was because I was coding for an RP server. I guess posting here helped me get recognized.
Note: Would any of you like to add me on steam?