Inside the check, do I hedge to global storage? Where x is the monster id and value I want?
example
if x[monsterId] ...
Game.setStorageValue(x,10)
x = {}
x[monsterId] = 10
if x[monster:getId()] == 10 then
print("true")
end
Game.setStorageValue(x[monster:getId()], 10)
x = {
[1] = 1000, -- demon
}
local monsterId = monster:getId()
x[monsterId] = value
if x[monsterId] == value then
...
end
You can't use Monster:setStorageValue() so you would have to use a global variable (ex Game.setStorageValue(x, value))
Create a table with the monster names (if you want it to be for all monsters) with a value or use the monsters unique id:
LUA:x = { [1] = 1000, -- demon } local monsterId = monster:getId() x[monsterId] = value if x[monsterId] == value then ... end
Inside the check, do I hedge to global storage? Where x is the monster id and value I want?
example
if x[monsterId] ...
Game.setStorageValue(x,10)
x = {}
x[monsterId] = 10
if x[monster:getId()] == 10 then
print("true")
end
Game.setStorageValue(x[monster:getId()], 10)
Good idea, it workedx is what you call the table, monsterId is the name of the value, 10 is the value.
LUA:x = {} x[monsterId] = 10 if x[monster:getId()] == 10 then print("true") end Game.setStorageValue(x[monster:getId()], 10)