Jump to content

[Question] CreatePed issue.


Recommended Posts

Hi there,

First of I'd like to start by thanking MTA for this fantastic multiplayer, so let's cut to the chase huh?

Well I'm trying to create a ped in a script, but I'm not that use to Lua codes "yet" during this few days I've learned alot about it and so far I haven't had any problems at all until now.

So like I said before I'm trying to create a ped for starters, but every time I create the ped it never spawns there. I don't even know if the ped spawns at all. Also I have no clue what Dimension is, I'd guess it's kinda like a virtualworld as SA:MP have, I didn't really understand that.

local Johnson = createPed(211, -2034.68, -117.924, 1035.17) 
setPedRotation(Johnson, 105) 
setElementDimension(Johnson, 0) 
setElementInterior(Johnson, 3) 
  
function Test(thePed) 
    setElementPosition(thePed, -2034.68, -117.924, 1035.17) 
    setPedRotation(thePed, 105) 
end 
setTimer(Test, 3000, 0, Johnson) 

Any Ideas what it can be?

-Sincerely

Ben

Link to comment

No need to mess with timers for this. Creating the ped and setting the rotation and interior is enough. Elements are created in dimension 0, so you don't need to set it either. The script looks fine for me, you better check if it gets executed at all using output functions, such as these:

outputChatBox 
outputServerLog 
outputDebugString 

Link to comment

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...