11-16-2020, 03:46 AM
Hi there again,
I'm trying "implement" the logic that you explained in this post:
But, I simply cannot turn off the special area since I cannot get the information when the monster die.
My code is like that:
I'm trying "implement" the logic that you explained in this post:
But, I simply cannot turn off the special area since I cannot get the information when the monster die.
My code is like that:
-- Persist 1 : Turning on the Special Areas on targeting
sa = {
'Targeting/Special Areas/0/Enabled',
'Targeting/Special Areas/1/Enabled',
'Targeting/Special Areas/2/Enabled',
'Targeting/Special Areas/3/Enabled',
'Targeting/Special Areas/4/Enabled',
'Targeting/Special Areas/5/Enabled',
'Targeting/Special Areas/6/Enabled',
'Targeting/Special Areas/7/Enabled',
'Targeting/Special Areas/8/Enabled',
'Targeting/Special Areas/9/Enabled'
}
if getlurelocation().posx == self().posx and getlurelocation().posy == self().posy and getlurelocation().posz == self().posz and hastarget() == true then
for _, sqm in ipairs(sa) do
if getsettings(sqm) == false then
setsettings(sqm, 'yes')
end
end
endsa = {
'Targeting/Special Areas/0/Enabled',
'Targeting/Special Areas/1/Enabled',
'Targeting/Special Areas/2/Enabled',
'Targeting/Special Areas/3/Enabled',
'Targeting/Special Areas/4/Enabled',
'Targeting/Special Areas/5/Enabled',
'Targeting/Special Areas/6/Enabled',
'Targeting/Special Areas/7/Enabled',
'Targeting/Special Areas/8/Enabled',
'Targeting/Special Areas/9/Enabled'
}
if target().ismonster == false and getsettings(sa[0])== true then
for _, sqm in ipairs(sa) do
setsettings(sqm, 'no')
end
end
