hackermagus

onMarkerHit problem

Recommended Posts

https://drive.google.com/file/d/1ZBAJXL5H_o2Xfc15ggXSTOAFAZHr4UPD/view?usp=sharing

I made a video to show my problem and I'm not the best at english so I dont know to write it..

But (video) the red marker is knows when I go in that in chat box there are shown my text but I want to show when I go into the yellow marker. The red marker is from a script and this script types is map. I made a script to the yellow marker:

local myMarker = createMarker(1675.8000488281, -1004.5, 23.10000038147, 'cylinder', 1, 191, 148, 0, 255) -- create myMarker

function MarkerHit( hitElement, matchingDimension ) -- define MarkerHit function for the handler
    local elementType = getElementType( hitElement ) -- get the hit element's type
    outputChatBox( "ASdasdasdasdasdasdasdasd" ) -- attach the element's type with the text, and output it
end
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) -- attach onMarkerHit event to MarkerHit function

And I know the createMarker position is the yellow marker position not the red one.

I hope you understand what i write xd

Thanks for helping

Share this post


Link to post
3 minutes ago, Avival said:

@hackermagus You have other function called MarketHit?

No

Share this post


Link to post
Posted (edited)
10 minutes ago, hackermagus said:

No

So that problem doesn't have to happen. Try changing the name of the variables and change the size of marker or add more Z position, Apparently it does not detect the collision

Edited by Avival

Share this post


Link to post

Try,

local myMarker = createMarker(1675.8000488281, -1004.5, 23.10000038147, 'cylinder', 1, 191, 148, 0, 255) -- create myMarker

function MarkerHit(hitElement, matchingDimension)
    local elementType = getElementType(hitElement)
    if source == myMarker then
        outputChatBox("ASdasdasdasdasdasdasdasd")
    end
end
addEventHandler("onMarkerHit", root, MarkerHit)

 

Share this post


Link to post
Posted (edited)
local myMarker = createMarker(1675.8000488281, -1004.5, 23.10000038147, 'cylinder', 1, 191, 148, 0, 255) -- create myMarker

function MarkerHit(hitElement, matchingDimension)
    local elementType = getElementType(hitElement)
    if elementType == "player" then
        outputChatBox("ASdasdasdasdasdasdasdasd",hitElement)
    end
end
addEventHandler("onMarkerHit", root, MarkerHit)

@hackermagus

 

Edited by DiGiTal

Share this post


Link to post

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.