Scripts / need help with follower script.

Author
Message
salvo
9
Years of Service
User Offline
Joined: 24th May 2015
Location:
Posted: 21st May 2016 17:36
hello guys i m a very fresh newbie with script and need help.
I need help with the follower script. how i can make the follower die its game over?


this is the script for the follower

ps:sorry for me bad english

[spoiler]
function follow_player_init(e)
CharacterControlUnarmed(e)
end

function follow_player_main(e)
PlayerDist = GetPlayerDistance(e)
if GetPlayerDistance(e) > 100 then
LookAtPlayer(e)
if GetPlayerDistance(e) < 200 then
SetCharacterToWalk(e)
else
SetCharacterToRun(e)
end
AIEntityGoToPosition(g_Entity[e]['obj'],g_PlayerPosX,g_PlayerPosZ)
else
AIEntityStop(g_Entity[e]['obj'])
StopAnimation(e)
end
end
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st May 2016 22:07 Edited at: 21st May 2016 22:08
im not sure if there is a direct command to lose the game but you can just set the player's lives to 0 and then kill him to end the game
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
salvo
9
Years of Service
User Offline
Joined: 24th May 2015
Location:
Posted: 21st May 2016 23:23
its work perfect thx smallg you are the best .
PM
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 23rd May 2016 23:41
If it was me I might consider adding TransportToIfUsed(e) to transport the player to a Story Zone and have a cutscene play just before he dies, to explain the death.
Julian
PM

Login to post a reply

Server time is: 2024-12-22 17:57:53
Your offset time is: 2024-12-22 17:57:53