This is a bodyguard code that spawns Two Peds... Gary and Johnny I mixed a couple of commands from different scripts. Test it and tell me how it goes.
ImportScript("\\Library\\LibTable.lua") -- imports the LibTable library
ImportScript("\\Library\\LibPed.lua") -- imports the LibPed library
local l_0_0 = false
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
local l_1_0 = 274 -- X coords
local l_1_1 = -111 -- Y coords
local l_1_2 = 6.40000094275 -- Z coords
PlayerSetHealth(300) -- gives the player 300 health
AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2) -- teleports the player to the sidewalk outside the boys dorm
WeatherSet(5)
AreaSetDoorPathableToPeds(TRIGGER._BUSDOORS, true)
--BodyGuard Code--
l_0_3 = PedCreatePoint(130, POINTLIST._BEGGINING, 1) -- Gary
l_0_4 = PedCreatePoint(217, POINTLIST._BEGGINING, 1) -- Johnny(BOSS)
PedSetActionTree(l_0_3, "/Global/Nemesis", "Act/Anim/Nemesis.act") -- Gary
PedSetActionTree(l_0_4, "/Global/G_Johnny", "Act/Anim/G_Johnny.act") -- Johnny(BOSS)
-- PedSetTaskNode(l_0_3, "/Global/AI", "Act/AI/AI.act")
-- PedSetTaskNode(gPlayer, "/Global/Player", "Act/Player.act")
ClothingGivePlayerOutfit("Panda") -- Gives Player Panda Outfit "Check in your room!"
-- Test Code Start
-- PedSetAITree(l_0_3, "/Global/AI", "Act/AI/AI.act")
--PedSetMaxHealth(idDarby, 500)
--PedSetHealth(idDarby, 500)
-- PedSetActionTree ("/Global/WrestlingACT......Act", "/Anim/WrestlingACT.act")
PedSetInfiniteSprint(gPlayer, true)
SoundEnableInteractiveMusic(true)
DisablePunishmentSystem(true)
AreaSetDoorOpen(TRIGGER._TSCHOOL_FRONTGATE, true)
AreaSetPopulationSexGeneration(true, true)
PedSetAlwaysStrafe(gPlayer, "Act/Default.act", true)
-- ButtonHistoryEnableActionTreeInput
-- test code end
-- Ally Blip Code Start
l_2_7 = AddBlipForChar(l_0_3, 6, 2, 2)
l_2_8 = AddBlipForChar(l_0_4, 6, 2, 2)
PedSetInfiniteSprint(l_0_3, true)
PedSetInfiniteSprint(l_0_4, true)
PedRecruitAlly(gPlayer, l_0_3)
PedRecruitAlly(l_0_3, l_0_4)
--Code End
end
MissionCleanup = function() -- mission cleanup function
ClearTextQueue() -- Clears all queued text in active memory
EnablePOI() -- Enables the POI Interface
gMissionRunning = false -- Terminates Mission Script
shared.gMissionEventFunction = nil -- This is for shared events
WeatherRelease() -- Releases the Weather Settings
PlayerSetControl(1) -- Sets Controller to be used for player
PlayerSetPunishmentPoints(-1) -- Sets Punishment Points.
CollectGarbage()
end
main = function() -- Function Call
F_MissionSetup() -- Mission Setup Function
F_UpdateGlobalHatred() -- Sets everyone to hate eachother and fight.
gMissionRunning = true -- This tells the game that this mission is running.
while gMissionRunning do -- This instructs bully to execute further tasks while the mission is running.
UpdateTextQueue() -- Updates the state of text stored in active memory
Wait(0) --Waits
end -- End Statement
end