Connection ErrorBad RequestThis page went staleSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
This page went stale
Your security token was rejected, usually because the page sat open too long or you signed in elsewhere. Nothing was saved. Reload the page and try again.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
Hello everyone. Is it possible to implement a check so that if a specific player is controlled by AI, the map script is simply not executed, but if it's a human player, then it is executed. It seems to be done through DoFile and creating several additional Lua files, but I don't know how to implement it specifically. Maybe someone can help?
You can create other Lua files next to MapScript.lua (or in another folder, the main thing is to write the correct path later) and write scripts in them. To execute the scripts written there, you need to write in MapScript:
doFile('script.lua')
Accordingly, to prevent them from being executed if the player is a computer, you can make a check:
if IsAIPlayer(PLAYER_..) == 0 then doFile('script.lua') end;
Here, 0 means the player is human, and 1 means the player is a computer.