Skip to content
User Avatar
#2956
Auto-translated
Jewill
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.

Statistics

Welcome our newest member: artem

Users Online 2 users 1568 guests