mapName = ""
mapName = name
addEventHandler("getMapName", getRootElement(), getMapName)
local mapName = getMapName()
if mapName and mapName ~= "None" then
triggerClientEvent(source, "getMapName", source, mapName)
addEventHandler("requestMapName", getRootElement(), requestMapName)
when using the "requestMapName" function, the "mapName" variable will equal the name of the current map
And capturing and drawing the screen on the correct processing order.
It has nothing to do with maths.
But with breaking down the instructions (for the computer) in to pieces and debug every piece individually.
When running this code you gave the computer 4 instructions.
1. Load the file
Runs a debug line if added.
2. Attach the eventhandler (returns true if attached, which is a value you can debug)
3. The event is fired, which calls the function you have attached.
If you did add a debug line here, you would have noticed that the code didn't run. (If the debug line is not visible, then there must have been something with the addEventHandler)
Hmmmmaybe compare the code to something similar that does work?
4. Call your custom function.
Check which value it returns.
This is something that takes time to learn. So maybe put some more time in debug your code in details. This will save you a lot of time in the long run.