M MY Multiplayer: Wiki
Side
Kind

createPed

Client

Creates a ped that exists on this client only.

Also exists on the server, with its own implementation: createPed

ped|false createPed(string model, float x, y, z [, float rotation = 0])

Parameters

NameTypeDescription
modelstringThe ped model's name, such as male01.
x, y, zfloatPosition in the world, or a vec3.
rotationfloatRotation in degrees around the Z axis.default 0

Returns

The created ped, or false if the model is not a ped model or the ped could not be created.

The ped starts with 100 health. Other players do not see it.

Example

local ped = createPed("male01", 2495.0, -1685.0, 13.5, 90)
setPedEnterVehicle(ped)

See also