McDota
McDota copied to clipboard
Lua Execution
is there an example of how to use the Lua Execution
I am looking too. I have not seen any examples about this.
https://github.com/LWSS/McDota/issues/41
so will something like this works ?
for i = 1, Heroes.Count() do
local hero = Heroes.Get(i)
local name = NPC.GetUnitName(hero)
if not heroList[name] and not NPC.IsIllusion(hero) then
heroList[name] = hero
end
end
print( "[ ---> CHEAT SCRIPT LOAD SUCCESS <--- ]" )
print( "[CHEAT]: MAP: " .. GetMapName() )
if GameRules ~= nil then
print( "[CHEAT]: GameRules:GetGameTime: " .. GameRules:GetGameTime() )
end
if IsClient() then
print( "[CHEAT]: IsClient" )
end
if IsDedicatedServer() then
print( "[CHEAT]: IsDedicatedServer" )
end
if IsServer() then
print( "[CHEAT]: IsServer" )
end
if IsInToolsMode() then
print( "[CHEAT]: IsInToolsMode" )
end
if Entities ~= nil then
print( "[CHEAT]: Entities ok" )
end
if HeroList ~= nil then
print( "[CHEAT]: HeroList ok" )
end
if PlayerResource ~= nil then
print( "[CHEAT]: PlayerResource ok" )
end
if ParticleManager ~= nil then
print( "[CHEAT]: ParticleManager ok" )
end
if ConVars ~= nil then
print( "[CHEAT]: ConVars ok" )
end
if CustomGameEventManager ~= nil then
print( "[CHEAT]: CustomGameEventManager ok" )
end
if CustomNetTables ~= nil then
print( "[CHEAT]: CustomNetTables ok" )
end
if Tutorial ~= nil then
print( "[CHEAT]: Tutorial ok" )
end
function npc_spawned( event )
if EntIndexToHScript ~= nil and event ~= nil then
local spawnedUnit = EntIndexToHScript( event.entindex )
if spawnedUnit ~= nil then
print( "[CHEAT]: npc_spawned:spawnedUnit" )
if spawnedUnit:IsHero() then
print( "[CHEAT]: npc_spawned:IsHero" )
end
if spawnedUnit:IsRealHero() then
print( "[CHEAT]: npc_spawned:IsRealHero" )
end
end
end
print( "[CHEAT]: npc_spawned" )
end
ListenToGameEvent("npc_spawned",npc_spawned,nil)
DebugDrawScreenTextLine(150,50,1,"dota 2 easy hack",0,255,0,255,60.0)
Here is bazinga.lua from when I tested (not my lua code)
thank you