Jump to content

hat script


WIRECOM

Recommended Posts

10 minutes ago, The_GTA said:

Hello WIRECOM,

have you tried using the bone_attach resource and attaching the hat object to the head bone of your ped? What kind of hat are you trying to display on the head?

 a beret, i've got the model from samp.

i know about the bone_attach thingy but i couldn't figure out how to use it

Can you possibly drop a piece of code i can add to the Bone attach script to place an object over head when ever i run a command (/hat) thx

Link to comment
9 minutes ago, WIRECOM said:

 a beret, i've got the model from samp.

i know about the bone_attach thingy but i couldn't figure out how to use itCan you possibly drop a piece of code i can add to the Bone attach script to place an object over head when ever i run a command (/hat) thx

local object = createObject(hat_model, 0, 0, 0)
exports.bone_attach:attachElementToBone(object, localPlayer, 1, 0, 0, 0, 0, 0, 0)

clientside script. not tested.

addCommandHandler("hat", function(p)
    local object = createObject(hat_model, 0, 0, 0)
    exports.bone_attach:attachElementToBone(object, p, 1, 0, 0, 0, 0, 0, 0)
  end
);

serverside version.

Edited by The_GTA
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...