News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: I want to change bodyguard Lola to Johnny with lua  (Read 1700 times)

0 Members and 1 Guest are viewing this topic.

Offline Johnny Hopkins

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
I want to change bodyguard Lola to Johnny with lua
« on: February 06, 2013, 02:22:14 AM »
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 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  PlayerSetHealth(200) -- gives the player 200 health
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2) -- teleports the player to the sidewalk outside the boys dorm
  local l_1_3 = 25 -- Lola (this is her model id number)
  local l_1_4, l_1_5, l_1_6 = PedGetPosXYZ(gPlayer) -- gets coordinates of the player on the map
  local l_1_7 = PedCreateXYZ(l_1_3, l_1_4 + 1, l_1_5 + 1, l_1_6) -- create a ped (Lola) and spawn them near the player
  PedRecruitAlly(gPlayer, l_1_7, true) -- recruits the spawned ped as a bodyguard (local l_1_7 is assigned to model id 25 which is Lola)
  PedMakeAmbient(l_1_7) -- makes the spawned ped ambient
end
 
MissionCleanup = function() -- mission cleanup function
end -- end statement
 
main = function() -- Main mission function
  repeat -- This makes the script run until the bodyguard is dismissed, attacked by the player or the player is busted
    Wait(0) -- wait 0 seconds
  until l_0_0 ~= false
  Wait(3000) -- wait 3 seconds
  MissionSucceed() -- ends mission
end



So .... What do I have to change?????

deadpoolXYZ

  • Guest
Re: I want to change bodyguard Lola to Johnny with lua
« Reply #1 on: February 06, 2013, 08:57:45 AM »
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 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  PlayerSetHealth(200) -- gives the player 200 health
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2) -- teleports the player to the sidewalk outside the boys dorm
  local l_1_3 = 25 -- Lola (this is her model id number)
  local l_1_4, l_1_5, l_1_6 = PedGetPosXYZ(gPlayer) -- gets coordinates of the player on the map
  local l_1_7 = PedCreateXYZ(l_1_3, l_1_4 + 1, l_1_5 + 1, l_1_6) -- create a ped (Lola) and spawn them near the player
  PedRecruitAlly(gPlayer, l_1_7, true) -- recruits the spawned ped as a bodyguard (local l_1_7 is assigned to model id 25 which is Lola)
  PedMakeAmbient(l_1_7) -- makes the spawned ped ambient
end
 
MissionCleanup = function() -- mission cleanup function
end -- end statement
 
main = function() -- Main mission function
  repeat -- This makes the script run until the bodyguard is dismissed, attacked by the player or the player is busted
    Wait(0) -- wait 0 seconds
  until l_0_0 ~= false
  Wait(3000) -- wait 3 seconds
  MissionSucceed() -- ends mission
end

Change the Red number to 23. If you want another ped then just change the number to another one.