It is not necessary to create the marker on the server and then do a trigger, it can work perfectly if you do everything on the client
Marker = createMarker( 1508.814453125 , -1144.19921875 , 140.93536376953, "cylinder", 1, 255, 0, 0)
addEventHandler("onClientMarkerHit", Marker,
function(element, dim)
if element == localPlayer and dim then
if not dm_window then
dm_window = guiCreateWindow(0.1556,0.1597,0.6375,0.6944,"Team-Panel",true)
grove_button = guiCreateButton(10,108,162,165,"Team-1",false,dm_window)
police_button = guiCreateButton(285,108,162,165,"Team-2",false,dm_window)
teams_label = guiCreateLabel(159,44,145,47,"",false,dm_window)
else
guiSetVisible(dm_window, true)
end
showCursor(true)
end
end
)
But if you still want to continue doing it with a server to client trigger, I'll leave you how to do it
server
Marker = createMarker( 1508.814453125 , -1144.19921875 , 140.93536376953, "cylinder", 1, 255, 0, 0)
function openwindow(thePlayer, dim)
local elementType = getElementType(thePlayer)
if elementType == "player" and dim then
triggerClientEvent(thePlayer,"opengui1window", thePlayer)
end
end
addEventHandler("onMarkerHit", Marker, openwindow)
client
addEvent("opengui1window", true)
addEventHandler("opengui1window", root,
function()
if not dm_window then
dm_window = guiCreateWindow(0.1556,0.1597,0.6375,0.6944,"Team-Panel",true)
grove_button = guiCreateButton(10,108,162,165,"Team-1",false,dm_window)
police_button = guiCreateButton(285,108,162,165,"Team-2",false,dm_window)
teams_label = guiCreateLabel(159,44,145,47,"",false,dm_window)
else
guiSetVisible(dm_window, true)
end
showCursor(true)
end
)