[LUA] My lua script doesn't work!

Status
Not open for further replies.

fb2017

Chieftain
Joined
Oct 8, 2017
Messages
53
I simply get this error:
Code:
[16495.250] Runtime Error: Assets\DLC\Expansion2\UI\InGame\InGame.lua:1262: attempt to index local 'addinFile' (a nil value)
[16495.250] Runtime Error: Error loading Assets\DLC\Expansion2\UI\InGame\InGame.lua.

Spoiler Lua script :

local samiLeader = "LEADER_FEB_LARS"
function checkResource(iPlayer)
local pPlayer = Players[iPlayer]
if GameInfo.Leaders[pPlayer:GetLeaderType()].Type == GameInfo.Leaders[samiLeader].Type then
print("This player is playing as the Sami")
for pCity in pPlayer:Cities() do
for i = 0, pCity:GetNumCityPlots() - 1, 1 do
local pPlot = pCity:GetCityIndexPlot(i)
if pPlot:GetResourceType() == GameInfo.Resources["RESOURCE_DEER"] then
pPlayer:ChangeNumResourceTotal(GameInfo.Resources["RESOURCE_HORSE"], 2);
end
end
end
end
end
GameEvents.PlayerDoTurn.Add(checkResource)


* The LUA script is not imported as VFS.

I've done this (I've tried without the "code/" too):



Help me, plz
 
Status
Not open for further replies.
Top Bottom