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


Author Topic: Help me with this script  (Read 2332 times)

0 Members and 1 Guest are viewing this topic.

Offline Sanic

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Help me with this script
« on: May 24, 2015, 07:13:54 AM »
Im trying to get local multiplayer to working but i´m ending up with infinite loadscreens im trying to modify ArcRace1.lur but whenever i want to start my script it just start a infinite loadscreen
Heres my code:

main = function()
  SecondPlayer = PedCreateXYZ(37,270,-110,7)
  ThirdPlayer = PedCreateXYZ(23,270,-105,7)
 
  PedSetActionTree(SecondPlayer,"/Global/P_Striker_A","Act/P_Striker_A.Act")
  PedSetActionTree(ThirdPlayer,"/Global/G_Striker_A","Act/G_Striker_A.Act")

  PedSetAITree(SecondPlayer,"/Global/PlayerAI","Act/PlayerAI.act") 
  PedSetAITree(ThirdPlayer,"/Global/PlayerAI","Act/PlayerAI.act")

  PedSetControllerID(SecondPlayer,1)
  PedSetControllerID(ThirdPlayer,2)
 
  repeat
    Wait(0)
  until not Alive
end

Offline embas10

  • Jr. Member
  • **
  • Posts: 27
  • Gender: Male
    • View Profile
Re: Help me with this script
« Reply #1 on: May 24, 2015, 10:28:32 AM »
Only the main function on your lua file?
Of course it's only loadscreen appears.
You should do it's like this.
Code: [Select]

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
 
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
 
end
 
MissionCleanup = function()
end

main = function()
  SecondPlayer = PedCreateXYZ(37,270,-110,7)
  ThirdPlayer = PedCreateXYZ(23,270,-105,7)
 
  PedSetActionTree(SecondPlayer,"/Global/P_Striker_A","Act/P_Striker_A.Act")
  PedSetActionTree(ThirdPlayer,"/Global/G_Striker_A","Act/G_Striker_A.Act")

  PedSetAITree(SecondPlayer,"/Global/PlayerAI","Act/PlayerAI.act") 
  PedSetAITree(ThirdPlayer,"/Global/PlayerAI","Act/PlayerAI.act")

  PedSetControllerID(SecondPlayer,1)
  PedSetControllerID(ThirdPlayer,2)
 
  repeat
    Wait(0)
  until not Alive
end



deadpoolXYZ

  • Guest
Re: Help me with this script
« Reply #2 on: May 24, 2015, 11:46:49 AM »
It crashes because you didn't create an area transition for the player.
It's not 100% necessary to create a mission setup and mission cleanup.

Offline Sanic

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Help me with this script
« Reply #3 on: May 24, 2015, 12:57:16 PM »
Thanks Guys
it works now :D but when i spawn the ped it just auto attacks and i cant control it how do i fix it?
 and i need to know which controller is which number keyboard=0?

deadpoolXYZ

  • Guest
Re: Help me with this script
« Reply #4 on: May 24, 2015, 01:12:06 PM »
The numbers correspond to the device that is controlling jimmy rather than an specific type of controller input (keyboard, xbox360 controller, etc). For example if you have a keyboard (kinda obvious  :P) and an xbox 360 controller plugged in your pc and you are using the keyboard to play, then the keyboard becomes number 0 and the 360 controller becomes 1. But if you are playing with the xbox 360 controller then it becomes 0 and the keyboard becomes 1. Keep in mind that this doesn't work with third party controllers unless you can emulate a 360 controller with some program. By the way you have a third controller?

Johnny or Derby autoattacks? or both?

Offline Sanic

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Help me with this script
« Reply #5 on: May 24, 2015, 01:25:58 PM »
First of all thanks for the quick replies
So i want to coop so i am Jimmy and i can change to darby with your Mod :D and i want that my brother plays with johnny with his boss or freeroam style
I´am playing with a ps3 controller signed as a Xbox controller and i have a second normal controller that i can also sign as a xbox controller so i dont use the keyboard neither by brother
I changed the script so that just one ped spawns and that is Johnny but i cant control him even if i change his style to Jimmy´s style i only can control Jimmy  Johnny only stand there doing nothing however if i change his style to Johnny´s style he auto attacks :( and i cant control him either.
So the best solution would be that my brother could use Johnny and his boss style like in your mod and i could change to darby That would be awesome but i cant even control him