Scripts / How do i put two scripts together?

Author
Message
Mrimtheleader1
7
Years of Service
User Offline
Joined: 9th May 2016
Location:
Posted: 1st May 2017 15:17
I have one script connected to an AI called "ai_classiccharacter_unarmed".
And im trying to add another script to that script.
The other script i want to put into it is "Civilian2" By Smallg.

so im trying to combine
ai_classiccharacter_unarmed
Civilian2.

Basically i want the AI going down the waypoint but when the player attacks them or near them, they start running away from the player.


Thank you.
PM
Freakon
GameGuru TGC Backer
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: UK
Posted: 2nd May 2017 08:45 Edited at: 2nd May 2017 08:46
Hey, I'm pretty sure Civilian2 does exactly that:
Quote: "Basically i want the AI going down the waypoint but when the player attacks them or near them, they start running away from the player."


no need to add ai_classiccharacter_unarmed

Civ2 follows waypoints, and runs away when shots fired near them!?
Nathan38
13
Years of Service
User Offline
Joined: 13th Feb 2011
Location:
Posted: 4th May 2017 21:43
Do you mean like an "include" in other languages?

LUA allows you to "require" other files, which I believe is more or less the same thing.

See this link for more info:
https://www.lua.org/pil/8.1.html

I'd be wary doing this if you are unsure of exactly how the scripts work though, including similar functions/variables from multiple scripts could cause a mess!

Login to post a reply

Server time is: 2024-04-24 23:23:02
Your offset time is: 2024-04-24 23:23:02