Code: Select all
if italy.alliance.id == 2 then
ChangeFactionAlignment(game:GetFactionById(15), spain.alliance, - math.random(35,45)
endModerators: Slitherine Core, The Lordz
Code: Select all
if italy.alliance.id == 2 then
ChangeFactionAlignment(game:GetFactionById(15), spain.alliance, - math.random(35,45)
endCode: Select all
local italy = game:GetFactionById(8)
local spain = game:GetFactionById(15)
if italy.alliance.id == 2 then
ChangeFactionAlignment(game:GetFactionById(15), spain.alliance, math.random(35,45)
end


Oh! If I want this script triggers only once, ¿is it possible?
Code: Select all
local italy = game:GetFactionById(8)
local spain = game:GetFactionById(15)
if GetEvent("SpainJoinsCP") == 0
and italy.alliance.id == 2 then
ChangeFactionAlignment(game:GetFactionById(15), spain.alliance, math.random(35,45))
SetEvent("SpainJoinsCP", -1)
end
Code: Select all
if GetEvent("SpainJoinsCP") == 0
and italy.alliance.id == 2 then
local luck = math.random(1,6)
if luck <= 4 then
ChangeFactionAlignment(game:GetFactionById(15), spain.alliance, math.random(35,45))
SetEvent("SpainJoinsCP", -1)
else
ChangeFactionAlignment(game:GetFactionById(15), spain.alliance, - math.random(35,45))
SetEvent("SpainJoinsCP", -1)
end
end

Code: Select all
function BlahBlahBlah()
local italy = game:GetFactionById(8)
local spain = game:GetFactionById(15)
if GetEvent("BlahBlahBlah") == 0
and italy.alliance.id == 2 then
ChangeFactionAlignment(game:GetFactionById(15), spain.alliance, math.random(35,45))
SetEvent("BlahBlahBlah", game.turn)
end
end
