M MY Multiplayer: Wiki
Side
Kind

createPed

Server

Creates a ped on the server, seen by every player.

Also exists on the client, 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.

The ped is placed under the dynamic element of the resource that created it and starts with 100 health.

Example

local guard = createPed("male01", 1481.0, -1771.0, 18.8, 180)
giveWeapon(guard, "PISTOL", 60, true)

See also