Jump to content

Item attaching


Kafka

Recommended Posts

Hello,

I've got a problem. I downloaded "bone_attach" resource, and i wanted to do little script, which will attach item when I type a command "/przyczep". I created a script, but it doesn't work. Please, help me (and don't say, that I'm noob, I'm not experienced scripter. Remember your first problem.)

meta.xml:

  

    "Kafka" version="1.0.0" name="Przedmioty" description="Przyczepianie przedmiotow" type="script" /> 
    

przedmioty.lua

  
local przedmiot = createObject( 1210,0,0,0 ) 
local gracz = getLocalPlayer 
  
function przyczepPrzedmiot 
     exports.bone_attach:attachElementToBone(przedmiot,gracz,12,0,0,0,0,0,0)     
end 
addCommandHandler ( "przyczep", przyczepPrzedmiot ) 
  

And one thing more, I DON'T want attach script from "briefcaserace".

Thanks :)

Link to comment
(and don't say, that I'm noob, I'm not experienced scripter. Remember your first problem.)

Only the real noob, childish scripters do that. Relax ;)

przedmioty.lua

  
local przedmiot = createObject( 1210,0,0,0 ) 
local gracz = getLocalPlayer () --You forgot parenthesis 
  
function przyczepPrzedmiot 
     exports.bone_attach:attachElementToBone(przedmiot,gracz,12,0,0,0,0,0,0)     
end 
addCommandHandler ( "przyczep", przyczepPrzedmiot ) 
  

Link to comment
1234db.png

That means there are parenthesis BEFORE exports.

  
local przedmiot = createObject( 1210,0,0,0 ) 
local gracz = getLocalPlayer () --You forgot parenthesis 
  
function przyczepPrzedmiot () --Parenthesis here 
     exports.bone_attach:attachElementToBone(przedmiot,gracz,12,0,0,0,0,0,0)     
end 
addCommandHandler ( "przyczep", przyczepPrzedmiot ) 
  

Lol, my bad :D

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