Reggae Posted March 23, 2014 Share Posted March 23, 2014 local pickup = createPickup(2487.1398925781,-1667.7604980469,13.34375,3,1273,0) addEventHandler("onPickupHit",pickup,function(player) setElementData(player,"used_pickup",true) outputChatBox("Enter to buy /comprar",player) end) addCommandHandler("comprar",function(player) if getElementData(player,"used_pickup") then takePlayerMoney(player,50) end end) function ColShapeHit ( thePlayer, matchingDimension ) local detection = isElementWithinColShape ( thePlayer, pickup ) detection = detection and getElementDimension( thePlayer ) == getElementDimension( pickup ) if detection then outputChatBox("Command /comprar off",player) end I want the / buy command only works for those who have on pickup, but does not work. Anyone can use anywhere. the only for Those Who Are on the pickup can use the script? help me Arrange the script for me plis Link to comment
Castillo Posted March 23, 2014 Share Posted March 23, 2014 local pickup = createPickup ( 2487.1398925781, -1667.7604980469, 13.34375, 3, 1273, 0 ) addEventHandler ( "onPickupHit", pickup, function ( player ) setElementData ( player,"used_pickup", true ) outputChatBox ( "Enter to buy /comprar", player ) end ) addCommandHandler ( "comprar", function ( player ) local detection = isElementWithinColShape ( player, getElementColShape ( pickup ) ) if getElementData ( player, "used_pickup" ) then takePlayerMoney ( player, 50 ) end end ) 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