-- CLIENT
mapName = ""
function requestMapName()
triggerServerEvent("requestMapName", localPlayer)
end
addEvent("getMapName", true)
function getMapName(name)
mapName = name
end
addEventHandler("getMapName", getRootElement(), getMapName)
--SERVER
addEvent("requestMapName", true)
function requestMapName()
local mapName = getMapName()
if mapName and mapName ~= "None" then
triggerClientEvent(source, "getMapName", source, mapName)
end
end
addEventHandler("requestMapName", getRootElement(), requestMapName)
when using the "requestMapName" function, the "mapName" variable will equal the name of the current map