1LoL1 Posted February 14, 2016 Share Posted February 14, 2016 (edited) 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 February 15, 2016 by Guest Link to comment
KariiiM Posted February 14, 2016 Share Posted February 14, 2016 What you want to do and can you explain your problem more better? Link to comment
1LoL1 Posted February 14, 2016 Author Share Posted February 14, 2016 What you want to do and can you explain your problem more better? Not it's only when i take pickup. I need "thePlayer must be in pickup and must use "lalt" if thePlayer is not in pickup then can't use bindKey. Link to comment
KariiiM Posted February 14, 2016 Share Posted February 14, 2016 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
1LoL1 Posted February 14, 2016 Author Share Posted February 14, 2016 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
1LoL1 Posted February 15, 2016 Author Share Posted February 15, 2016 Any help please? Link to comment
Mann56 Posted February 15, 2016 Share Posted February 15, 2016 Agree with what Karim said, first you bindKey on the event "onPickupHit" and then make a custom event and get distance between two points , if distance exceeds by 4 or 5 then unbind the key , so the key will be bound till the player is near the pickup 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