Jump to content

Solved...


1LoL1

Recommended Posts

Hello, i created script but idk how i need functions. :(

i need player must be in pickup and must use bindKey("lalt") but idk how :(

For player must be in pickup i must use this?

isElementAttached 

and this i have

job = createPickup (x, y, z, nil, id, timer) 
  
function Job (thePlayer) 
local job = setPlayerTeam(thePlayer, team) 
if job then 
else 
cancelEvent() 
outputChatBox("text", thePlayer, 255, 255, 255, true) 
end 
end 
addEventHandler("onPickupHit", job, Job) 

so i must use this?

job = createPickup (x, y, z, nil, id, timer) 
  
function Job (thePlayer) 
local job = setPlayerTeam(thePlayer, team) 
if job then 
else 
cancelEvent() 
outputChatBox("text", thePlayer, 255, 255, 255, true) 
end 
end 
bindKey(thePlayer, "lalt", "down", Job) 

Edited by Guest
Link to comment

Hmm, as far as the event onPickupLeave not exists, it's possible to make a custom event,

You'll have to get the distance between the player and the pickup for example if the distance is more than 2meters then unbind the key.

Use these functions

getDistanceBetweenPoints3D 
--or 
getDistanceBetweenPoints2D 
unbindKey 
  

Link to comment
Hmm, as far as the event onPickupLeave not exists, it's possible to make a custom event,

You'll have to get the distance between the player and the pickup for example if the distance is more than 2meters then unbind the key.

Use these functions

getDistanceBetweenPoints3D 
--or 
getDistanceBetweenPoints2D 
unbindKey 
  

Not i mean player must be in pickup if want use bindKey and only now will script work when player will be in pickup.

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