TFS 0.4
I want to add checker in this script to check ( if the item have actionid = 15160 returns false and the script doesn’t spawn the item)
I want to add checker in this script to check ( if the item have actionid = 15160 returns false and the script doesn’t spawn the item)
local t = {
items = {{9562,1,1},{9562,1,1}}, -- goes item, max item count, rarity (5-1. 5 being always, 1 being rare)
positions = {
{x = 2444, y = 961, z = 6}, -- positions items can spawn, add more positions if needed
{x = 2436, y = 948, z = 6}, -- positions items can spawn, add more positions if needed
{x = 2455, y = 946, z = 6}, -- positions items can spawn, add more positions if needed
{x = 2459, y = 970, z = 6}, -- positions items can spawn, add more positions if needed
{x = 2451, y = 974, z = 6}, -- positions items can spawn, add more positions if needed
{x = 2438, y = 974, z = 6}, -- positions items can spawn, add more positions if needed
{x = 2460, y = 984, z = 6}, -- positions items can spawn, add more positions if needed
{x = 2433, y = 953, z = 6}, -- positions items can spawn, add more positions if needed
{x = 2436, y = 934, z = 6}, -- positions items can spawn, add more positions if needed
{x = 2432, y = 928, z = 6}, -- positions items can spawn, add more positions if needed
{x = 2440, y = 919, z = 6}, -- positions items can spawn, add more positions if needed
{x = 2458, y = 926, z = 6}, -- positions items can spawn, add more positions if needed
{x = 2412, y = 942, z = 6}, -- positions items can spawn, add more positions if needed
}
}
function onThink(interval)
local item = math.random(#t.items)
for a = 1, #t.positions do
if getTileItemById(t.positions[a], t.items[item][1]) ~= TRUE then
local amount = math.random(t.items[item][2])
if (math.random(99) <= t.items[item][3]) then
local itemZZ = doCreateItem(t.items[item][1], amount, t.positions[a])
doItemSetAttribute(itemZZ, "aid", 15160)
doBroadcastMessage("Demon tile has spawned somewhere on the bridge map! Be the first one to become a Demon! (+30% more HP!)", MESSAGE_STATUS_WARNING)
end
end
end
return true
end
Attachments
-
unknown.png88.3 KB · Views: 4 · VirusTotal
Last edited: