Jump to content

Need Help with my first script :)


Recommended Posts

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

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