FAQFAQ    Board RulesBoard Rules    SearchSearch    LotteryLottery    RouletteRoulette    UsergroupsUsergroups
     RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Shop    Log inLog in 
View posts since last visitView your postsView unanswered posts

Lifeguard for Player Script?

 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding
View previous topic :: View next topic  
Author Message
Frog_808

New Member
New Member


Joined: 13 May 2020
Posts: 15

42 Bank Notes
Items

PostPosted: Sun Nov 22, 2020 11:23 am    Post subject: Lifeguard for Player Script? Reply with quote

Hello, does anyone have an idea for an script of an enemy who guards the player?

(Follow player and shoot at enemys)

I would be grateful.
Back to top
View user's profile Send private message
SooperK

Junior Member
Junior Member


Joined: 10 Nov 2014
Posts: 48
Location: Jennewa, Airdenor
103 Bank Notes
Items

PostPosted: Mon Nov 23, 2020 12:14 am    Post subject: Lifeguard for Player Script? Reply with quote

Bodyguard script: In this example I used "sam" in findactor 0, but you would put in the name of whatever you named your bodyguard

enemy_vidim 0
dim_frm 4
dim_act 6
dim_flt 5
commandblock 1
findactor 0, "Sam"
findactor 5, "Tommy"
human_addweapon 0, 10, 50, 200
human_holster 0
frm_seton 3, 0
commandblock 0
human_set8slot 0, 1
let flt[3] = 1
{ up
if flt[3] = 0, -1, 1
Label F
enemy_action_follow 5, 1.2, CROUCH
goto F
label 1
goto 1
}
event use_ab
enemy_actionsclear
wingman_setindicator 0, 1, 0
enemy_vidim 1
label Follow
event_use_cb 1
if flt[3] = 1, 2, -1
enemy_forcescript 0
let flt[3] = 1
return
label 2
let flt[3] = 0
return

enemy_vidim 0
dim_frm 4
dim_act 6
dim_flt 5
commandblock 1
findactor 0, "Sam"
findactor 5, "Tommy"
human_addweapon 0, 10, 50, 200
human_holster 0
frm_seton 3, 0
commandblock 0
human_set8slot 0, 1
let flt[3] = 1
{ up
if flt[3] = 0, -1, 1
Label F
enemy_action_follow 5, 1.2, CROUCH
goto F
label 1
goto 1
}
event use_ab
enemy_actionsclear
wingman_setindicator 0, 1, 0
enemy_vidim 1
label Follow
event_use_cb 1
if flt[3] = 1, 2, -1
enemy_forcescript 0
let flt[3] = 1
return
label 2
let flt[3] = 0
return
Back to top
View user's profile Send private message
Frog_808

New Member
New Member


Joined: 13 May 2020
Posts: 15

42 Bank Notes
Items

PostPosted: Tue Nov 24, 2020 7:16 pm    Post subject: Lifeguard for Player Script? Reply with quote

Thanks! I will try it out.

Can you explain me, what "human_set8slot" do?
Back to top
View user's profile Send private message
SooperK

Junior Member
Junior Member


Joined: 10 Nov 2014
Posts: 48
Location: Jennewa, Airdenor
103 Bank Notes
Items

PostPosted: Tue Nov 24, 2020 9:00 pm    Post subject: Lifeguard for Player Script? Reply with quote

HUMAN_SET8SLOT XX,YY
???Allows an actor to have eight inventory slots?
xx == ID of Actor to set
yy == Toggle (1 = on,0 = off)

The above is directly copied out of SomebodY's improved Script Ref which can be downloaded from this site. Its an awesome tool I use alot to understand script
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Generation Time: 0.010 | Queries: 18