catsobelico Posted May 3, 2015 Share Posted May 3, 2015 Hi, im creating an Attach Element script but it doesn´t works, please tell me what im doing wrong i made this 2 scripts for a same resource called "hat" hats.lua (server) function mask ( source, hat ) local x, y, z = getElementPosition ( source ) local mask = createObject( 2054, float x, float y, float z + 5, [ float rx, float ry, float rz, bool isLowLOD = false ] ), float x, float y, float z, [ float rx, float ry, float rz, bool isLowLOD = false ] ) attachElements ( mask, source, 0, 0, 5 ) end addCommandHandler ( "hat", mask ) hats_c.lua (client) function mask ( hat ) local x, y, z = getElementPosition ( source ) --Get the players position local mask = createObject( 2054, float x, float y, float z + 5, [ float rx, float ry, float rz, bool isLowLOD = false ] ) attachElements ( tank, source, 0, 0, 5 ) --Attach the tank to the player. end addCommandHandler( "hat", mask ) Link to comment
Enargy, Posted May 3, 2015 Share Posted May 3, 2015 -- client function mask ( ) local x, y, z = getElementPosition ( getLocalPlayer() ) local mask = createObject( 2054, x ,y, z + 5) attachElements ( mask, getLocalPlayer(), 0, 0, 5 ) end addCommandHandler ( "hat", mask ) -- server function mask ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) --Get the players position local mask = createObject( 2054, x ,y, z + 5) attachElements ( mask, thePlayer, 0, 0, 5 ) --Attach the tank to the player. end addCommandHandler( "hat", mask ) Link to comment
catsobelico Posted May 4, 2015 Author Share Posted May 4, 2015 Muchas gracias por ayudar , voy a probar a ver que tal Link to comment
catsobelico Posted May 4, 2015 Author Share Posted May 4, 2015 Me da error en la consola dice lo siguuiente: Error: loading script failed: hats/hats.lua:3: expected near x Link to comment
Enargy, Posted May 4, 2015 Share Posted May 4, 2015 server.lua function maskk ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) --Get the players position local mask = createObject( 2054, x, y, z ) attachElements ( mask, thePlayer, 0, 0, 5 ) --Attach the tank to the player. end addCommandHandler( "hat", maskk ) PD: Español here viewforum.php?f=145 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now