1
item(id,"type")==51 and item(id,"x")==11 and item(id,"y")==16 and item(id,"exists")
It should check if there is a grenade at position x 11 y 16, and if that's the case, trigger a few other entities. But it doesn't work. What's the problem?
Maps/Editor
Trigger_if not working
Trigger_if not working
1

item(id,"type")==51 and item(id,"x")==11 and item(id,"y")==16 and item(id,"exists")
local itemlist=item(0,"table") for _,id in pairs(itemlist) do if item(id,"type")==51 and item(id,"x")==11 and item(id,"y")==16 and item(id,"exists") then
local itemlist=item(0,"table") for _,id in pairs(itemlist) do if item(id,"type")==51 and item(id,"x")==11 and item(id,"y")==16 and item(id,"exists") then
if local itemlist=item(0,"table") for _,id in pairs(itemlist) do if item(id,"type")==51 and item(id,"x")==11 and item(id,"y")==16 and item(id,"exists") then
(function() for _,id in pairs(item(0,"table")) do if item(id,"type")==51 and item(id,"x")==11 and item(id,"y")==16 then return true end end)()
mp_luamap set to 1
Re: Trigger_if not working
MikuAuahDark:
mp_luamap doesn't affect Trigger_If entities, I believe.
Infinite Rain:
Trigger_If must be a Boolean expression. This means Lua must be able to evaluate it and it has to be either true or false and nothing else.function doesItemExist() 	local itemlist=item(0,"table") 	for _,id in pairs(itemlist) do 		if item(id,"type")==51 and item(id,"x")==11 and item(id,"y")==16 and item(id,"exists") then 			return true 		end 	end 	return false end
doesItemExist()
and item(id,"exists")
item(0,"table")
Re: Trigger_if not working
Rainoth and
MikuAuahDark:
1
