Jump to content

[Help]Marker


TheSmart

Recommended Posts

Hey Guys!

I create a table that show 1 gui every time you enter one of the marker tables I made this but it won't work...Hope you understand :mrgreen::mrgreen:

(table Created by Darhal)

markersPosTable= { 
--{x, y, z, interior, dim} 
 {-23.60000038147, -55.299999237061, 1002.5999755859, 6, 3},  
} 
  
for k, v in pairs(markersPosTable) do 
 local marker= createMarker(v[1], v[2], v[3], "cylinder", 1.0, 0, 122, 43, 211) 
 setElementInterior(marker, v[4]) 
 setElementDimension(marker, v[5]) 
end 
  
function showgui (hitElement) 
       if (hitElement == localPlayer) then 
                 addEventHandler("onClientRender",root, dxPanel) 
                 showCursor(true)  
                 end  
         end 
addEventHandler("onClientMarkerHit", marker, showgui) 

i getting this error : - http://prntscr.com/98csds

Edited by Guest
Link to comment

Try opening GUI from server side (addEvent) and trigger it in client side and why addEventHandler inside function? it should be before function or after ending function..

marker= createMarker(v[1], v[2], v[3], "cylinder", 1.0, 0, 122, 43, 211) 

Ps: Its marker = not marker=

Link to comment
  • Moderators

Move these lines bellow the showgui function.

for k, v in pairs(markersPosTable) do 
    local marker= createMarker(v[1], v[2], v[3], "cylinder", 1.0, 0, 122, 43, 211) 
    setElementInterior(marker, v[4]) 
    setElementDimension(marker, v[5]) 
    addEventHandler("onClientMarkerHit", marker, showgui) 
end 

Link to comment
Move these lines bellow the showgui function.
for k, v in pairs(markersPosTable) do 
    local marker= createMarker(v[1], v[2], v[3], "cylinder", 1.0, 0, 122, 43, 211) 
    setElementInterior(marker, v[4]) 
    setElementDimension(marker, v[5]) 
    addEventHandler("onClientMarkerHit", marker, showgui) 
end 

Nope Still getting same error

Link to comment

You have to add the event for every marker you create

markersPosTable= { 
--{x, y, z, interior, dim} 
    {-23.60000038147, -55.299999237061, 1002.5999755859, 6, 3},  
} 
  
for k, v in pairs(markersPosTable) do 
    local marker= createMarker(v[1], v[2], v[3], "cylinder", 1.0, 0, 122, 43, 211) 
    addEventHandler("onClientMarkerHit", marker, showgui,false) 
    setElementInterior(marker, v[4]) 
    setElementDimension(marker, v[5]) 
end 
  
function showgui (hitElement) 
    if (hitElement == localPlayer) then 
        addEventHandler("onClientRender",root, dxPanel) 
        showCursor(true)  
    end  
end 

Link to comment
You have to add the event for every marker you create
markersPosTable= { 
--{x, y, z, interior, dim} 
    {-23.60000038147, -55.299999237061, 1002.5999755859, 6, 3},  
} 
  
for k, v in pairs(markersPosTable) do 
    local marker= createMarker(v[1], v[2], v[3], "cylinder", 1.0, 0, 122, 43, 211) 
    addEventHandler("onClientMarkerHit", marker, showgui,false) 
    setElementInterior(marker, v[4]) 
    setElementDimension(marker, v[5]) 
end 
  
function showgui (hitElement) 
    if (hitElement == localPlayer) then 
        addEventHandler("onClientRender",root, dxPanel) 
        showCursor(true)  
    end  
end 

not working still getting that error http://prntscr.com/98dw94

Link to comment
markersPosTable= { 
--{x, y, z, interior, dim} 
    {-23.60000038147, -55.299999237061, 1002.5999755859, 6, 3},  
} 
  
function showgui (hitElement) 
    if (hitElement == localPlayer) then 
        addEventHandler("onClientRender",root, dxPanel) 
        showCursor(true)  
    end  
end 
  
for k, v in pairs(markersPosTable) do 
    local marker= createMarker(v[1], v[2], v[3], "cylinder", 1.0, 0, 122, 43, 211) 
    addEventHandler("onClientMarkerHit", marker, showgui,false) 
    setElementInterior(marker, v[4]) 
    setElementDimension(marker, v[5]) 
end 

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