Jump to content

How to set a Ped (Interior)?


Fabelix

Recommended Posts

Regards,

 

First I apologize for my English. LOL

 

Come on... I am trying to create an NPC inside "interior 5". I can do that, but the NPC disappears instantly, right after the script starts.

 

Can anyone solve this problem that I have? I am certainly doing something wrong, but my little experience does not allow me to see what is wrong.

 

----

 

2nd Problem: The NPC is stopping animation and moving out of place (x, y, z) when the player punches or pushes.

 

I need this NPC not to get out of place (x, y, z) and keep doing the animation regardless of any situation.

 

😑 I believe it is something very simple that I am doing wrong and cannot understand. If anyone can help with these two problems, it will be a very important help.

 

ped1 = createPed(152, 321.88424682617, 1130.3310546875, 1084.52380371095)
    setElementDimension(0)
    setElementInterior(5)

function makePed() 
    setTimer(function() 
        setPedRotation(ped1, 0) 
        setPedAnimation(ped1, "STRIP", "strip_a") 
     end, 100, 1) 
end 
addEventHandler("onResourceStart", resourceRoot, makePed)

 

GIF of what happens when starting the script: https://imgur.com/a/kledQi0

 

Thank you! 😄

Edited by Fabelix
line break
Link to post
  • 2 months later...
  • 8 months later...
Quote
On 15/11/2019 at 10:35, Fabelix said:

Problem solved.

Hey, how you fixed that bro? i'm having ur same problem

  1. function prueba()
  2. local thePed = createPed(87, x, y, z, 315)
  3. setElementDimension(1)
  4. setElementInterior(17)
  5. setPedAnimation(thePed, "strip", "strip_E")
  6.  end 
  7. addCommandHandler("onResourceStart", prueba)

 

 



 

Edited by Alphabyte
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...