<globalevent name="dirMonster" type="startup" event="script" value="scripts/globalevents/directionMonster.lua"/>
function onStartup()
local config = {
[1] = {pos = {x = 227, y = 754, z = 8}, dir = 1},
[2] = {pos = {x = 231, y = 757, z = 8}, dir = 2},
[3] = {pos = {x = 223, y = 757, z = 8}, dir = 3},
[4] = {pos = {x = 223, y = 760, z = 8}, dir = 4}
}
for i = 1, #config do
local crt = getTopCreature(config[i].pos).uid
if crt > 0 and isMonster(crt) then
doCreatureSetLookDirection(crt, config[i].dir)
end
end
return true
end
But i need control it from rmein globalevents.xml
Code:<globalevent name="dirMonster" type="startup" event="script" value="scripts/globalevents/directionMonster.lua"/>
script directionMonster.lua:
Code:function onStartup() local config = { [1] = {pos = {x = 227, y = 754, z = 8}, dir = 1}, [2] = {pos = {x = 231, y = 757, z = 8}, dir = 2}, [3] = {pos = {x = 223, y = 757, z = 8}, dir = 3}, [4] = {pos = {x = 223, y = 760, z = 8}, dir = 4} } for i = 1, #config do local crt = getTopCreature(config[i].pos).uid if crt > 0 and isMonster(crt) then doCreatureSetLookDirection(crt, config[i].dir) end end return true end
pos is position of monster and dir is monster looking.
okNot for this version, the script that I shared with you is the only way.