SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF2 Modding => Topic started by: Alvio on July 10, 2019, 10:28:52 AM

Title: Need lua script
Post by: Alvio on July 10, 2019, 10:28:52 AM
Hello.

There is a character and he should be (by quantity) one.
But if a player chooses this character, and the bot of the same character is already on the map, then there are already two characters on the map.

I used to have a script, but I lost it.
Write on the memory and documentation does not work, i'm missing something...

Can anyone help?
Title: Re: Need lua script
Post by: wsa30h on July 10, 2019, 11:55:25 AM
try writing just 0 for that character for example sniper   = { "rep_inf_ep2_sniper",5, 12}, to sniper   = { "rep_inf_ep2_sniper",0, 0}, it only effects bots. doesent work with the droideka
Title: Re: Need lua script
Post by: Alvio on July 10, 2019, 01:07:30 PM
Thanks for the reply, but this is not what I need.
I will clarify ...

I put Kenobi as a normal unit.
   - if the player has not chosen him, then the bot will spawn,
   - if the player chooses it, but the bot (Kenobi) is already on the map and is still alive, then it turns out two Kenobi.
So, when a player (Kenobi) spawn, the bot (Kenobi) should disappear.

In my codes:
{"rep_hero_obiwan", 1, 1}

And also in map_name.lua:
In function ScriptPostLoad() should be something like this
OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then

KillObject("rep_hero_obiwan")

end
end
)


But it does not work, and still there are two Kenobi on the map (
Title: Re: Need lua script
Post by: wsa30h on July 10, 2019, 01:21:48 PM
oh ok sorry i dont think i can help with that  :confused:
EhPortal 1.34 © 2024, WebDev