TheSmart Posted November 29, 2015 Share Posted November 29, 2015 (edited) 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 (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 November 29, 2015 by Guest Link to comment
Om. Posted November 29, 2015 Share Posted November 29, 2015 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 IIYAMA Posted November 29, 2015 Moderators Share Posted November 29, 2015 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
TheSmart Posted November 29, 2015 Author Share Posted November 29, 2015 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
ALw7sH Posted November 29, 2015 Share Posted November 29, 2015 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
TheSmart Posted November 29, 2015 Author Share Posted November 29, 2015 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
ALw7sH Posted November 29, 2015 Share Posted November 29, 2015 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
TheSmart Posted November 29, 2015 Author Share Posted November 29, 2015 Thank You @Alw7sH its working now :D 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