kewizzle Posted April 15, 2017 Posted April 15, 2017 not even in the marker just above it and the GUI opens.
Pembo Posted April 15, 2017 Posted April 15, 2017 (edited) 25 minutes ago, kewizzle said: not even in the marker just above it and the GUI opens. Like how far above, just slightly? Also what size is your marker? Edited April 15, 2017 by Pembo
NeXuS™ Posted April 15, 2017 Posted April 15, 2017 Try this one. local markerE = createMarker(...) -- Creating the marker addEventHandler("onClientMarkerHit", markerE, function(hitElement) -- Event local _, _, mZ = getElementPosition(source) -- Marker position local _, _, pZ = getElementPosition(hitElement) -- Player position if pZ <= mZ + 3 then -- Checking if the player's position is below the marker position + 3 -- Do your code. end end) 1
kewizzle Posted April 16, 2017 Author Posted April 16, 2017 4 hours ago, NeXuS™ said: Try this one. local markerE = createMarker(...) -- Creating the marker addEventHandler("onClientMarkerHit", markerE, function(hitElement) -- Event local _, _, mZ = getElementPosition(source) -- Marker position local _, _, pZ = getElementPosition(hitElement) -- Player position if pZ <= mZ + 3 then -- Checking if the player's position is below the marker position + 3 -- Do your code. end end) ill try this out in a little bit.
kewizzle Posted April 16, 2017 Author Posted April 16, 2017 4 hours ago, NeXuS™ said: Try this one. local markerE = createMarker(...) -- Creating the marker addEventHandler("onClientMarkerHit", markerE, function(hitElement) -- Event local _, _, mZ = getElementPosition(source) -- Marker position local _, _, pZ = getElementPosition(hitElement) -- Player position if pZ <= mZ + 3 then -- Checking if the player's position is below the marker position + 3 -- Do your code. end end) doesnt open at all now function OpenWindow(thePlayer) local _, _, mZ = getElementPosition(source) -- Marker position local _, _, pZ = getElementPosition(hitElement) -- Player position if thePlayer == getLocalPlayer() and (getElementData(localPlayer,"Level")) <= 59 then outputChatBox("You must be atleast Level 60 to access the Special Weapon Shop!", 255, 0, 0) else if ( guiGetVisible ( specialWshop ) == false ) and thePlayer == getLocalPlayer() then guiSetVisible ( specialWshop, true ) showCursor ( true ) end end end addEventHandler("onClientMarkerHit", special, OpenWindow) addEventHandler("onClientMarkerHit", specialSC, OpenWindow)
NeXuS™ Posted April 16, 2017 Posted April 16, 2017 function OpenWindow(thePlayer) local _, _, mZ = getElementPosition(source) -- Marker position local _, _, pZ = getElementPosition(hitElement) -- Player position if pZ <= mZ + 3 then if thePlayer == getLocalPlayer() and (getElementData(localPlayer,"Level")) <= 59 then outputChatBox("You must be atleast Level 60 to access the Special Weapon Shop!", 255, 0, 0) else if ( guiGetVisible ( specialWshop ) == false ) and thePlayer == getLocalPlayer() then guiSetVisible ( specialWshop, true ) showCursor ( true ) end end end end addEventHandler("onClientMarkerHit", special, OpenWindow) addEventHandler("onClientMarkerHit", specialSC, OpenWindow) This doesn't work at all? 1
kewizzle Posted April 16, 2017 Author Posted April 16, 2017 1 hour ago, NeXuS™ said: function OpenWindow(thePlayer) local _, _, mZ = getElementPosition(source) -- Marker position local _, _, pZ = getElementPosition(hitElement) -- Player position if pZ <= mZ + 3 then if thePlayer == getLocalPlayer() and (getElementData(localPlayer,"Level")) <= 59 then outputChatBox("You must be atleast Level 60 to access the Special Weapon Shop!", 255, 0, 0) else if ( guiGetVisible ( specialWshop ) == false ) and thePlayer == getLocalPlayer() then guiSetVisible ( specialWshop, true ) showCursor ( true ) end end end end addEventHandler("onClientMarkerHit", special, OpenWindow) addEventHandler("onClientMarkerHit", specialSC, OpenWindow) This doesn't work at all? i sent you the wrong code i meant this function OpenWindow(thePlayer) local _, _, mZ = getElementPosition(source) -- Marker position local _, _, pZ = getElementPosition(hitElement) -- Player position if thePlayer == getLocalPlayer() and (getElementData(localPlayer,"Level")) <= 59 and pZ <= mZ + 3 then outputChatBox("You must be atleast Level 60 to access the Special Weapon Shop!", 255, 0, 0) else if ( guiGetVisible ( specialWshop ) == false ) and thePlayer == getLocalPlayer() then guiSetVisible ( specialWshop, true ) showCursor ( true ) end end end end addEventHandler("onClientMarkerHit", special, OpenWindow) addEventHandler("onClientMarkerHit", specialSC, OpenWindow) 1 hour ago, kewizzle said: i sent you the wrong code i meant this function OpenWindow(thePlayer) local _, _, mZ = getElementPosition(source) -- Marker position local _, _, pZ = getElementPosition(hitElement) -- Player position if thePlayer == getLocalPlayer() and (getElementData(localPlayer,"Level")) <= 59 and pZ <= mZ + 3 then outputChatBox("You must be atleast Level 60 to access the Special Weapon Shop!", 255, 0, 0) else if ( guiGetVisible ( specialWshop ) == false ) and thePlayer == getLocalPlayer() then guiSetVisible ( specialWshop, true ) showCursor ( true ) end end end end addEventHandler("onClientMarkerHit", special, OpenWindow) addEventHandler("onClientMarkerHit", specialSC, OpenWindow) yours works tho
Anubhav Posted April 16, 2017 Posted April 16, 2017 function OpenWindow(thePlayer) if getElementType( thePlayer ) == "player" then local _, _, mZ = getElementPosition(source) -- Marker position local _, _, pZ = getElementPosition(thePlayer) -- Player position if thePlayer == getLocalPlayer() and (getElementData(localPlayer,"Level")) <= 59 and pZ <= mZ + 3 then outputChatBox("You must be atleast Level 60 to access the Special Weapon Shop!", 255, 0, 0) else if ( guiGetVisible ( specialWshop ) == false ) and thePlayer == getLocalPlayer() then guiSetVisible ( specialWshop, true ) showCursor ( true ) end end end end addEventHandler("onClientMarkerHit", special, OpenWindow) addEventHandler("onClientMarkerHit", specialSC, OpenWindow)
xyzii Posted April 16, 2017 Posted April 16, 2017 Alternatively you could create a col sphere at the marker's location and open window when you hit the col.
Mr.Loki Posted April 16, 2017 Posted April 16, 2017 6 hours ago, xyzii said: Alternatively you could create a col sphere at the marker's location and open window when you hit the col. Why create a colSphere and use a colShape hit event when there's a marker hit event? That just makes no sense to me. 1
NeXuS™ Posted April 18, 2017 Posted April 18, 2017 @Mr.Loki, because colshapes has a height value, but markers go up on height very high. 2
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