Prevent class from spawning at CP
Posted: Thu Dec 05, 2013 7:59 pm
i didn't want to double post and get in trouble to bring back up my last post so i made this one
(I NEVER asked this question on my old post this is a NEW question concerning something posted on my old post)
someone named Locutus gave me a script so when my jedi class spawned at a certain command post they would get killed BUT only if they were AI (not players)
it doesn't work though so can anyone figure out why (It shouldn't be hard to do)
(I NEVER asked this question on my old post this is a NEW question concerning something posted on my old post)
someone named Locutus gave me a script so when my jedi class spawned at a certain command post they would get killed BUT only if they were AI (not players)
it doesn't work though so can anyone figure out why (It shouldn't be hard to do)
I think you can do it via Lua, too.
Place a region around your spawn path at the CP and add sth. like this:
OnCharacterSpawn(
function(character)
if GetCharacterClass(character) == "YOURJEDICLASS" then
checkJediRegion()
end
end
end
)
checkJediRegion()
OnEnterRegion(
function(region, player)
if IsCharacterHuman(player) then
print("Do nothing because jedi is human")
elseif GetCharacterClass(player) == "YOURJEDICLASS" then
KillObject (player)
end
end,
"YOURREGIONNAME"
)
end
This code kills a Jedi as soon as it's spawned and not controlled by a player.
Everything untested.