S
Shadow_
Guest
so i wrote the code and added a condition if targets > 0 then but the problem is there is no targets around and it still loads whatever inside the if, not that only it also loads the if even the condition is found or not and also passes through its else, i tried to add if targets then and it also passed so, there is something wrong with create_functions.lua or get spectators but im sure get spetators is fine.
@Nekiro @Evil Puncker what do you think guys, i couldn't think of anybody to mention but i think tfs developers might have an idea
never mind the mysql error
Lua:
function Player.start1v1(self, x, y, duration)
local targets = Game.getSpectators(self:getPosition(), false, true, x, x, y, y)
if #targets > 0 then
for i = 1, #targets do
if targets[i] then
if targets[i]:getStorageValue(storageT) <= os.time() then
targets[i]:setStorageValue(storageT, os.time() + duration)
self:setStorageValue(storageT, os.time() + duration)
table.insert(targetsLIB, targets[i])
table.insert(targetsLIB, self)
print("both should be affected by 1v1")
end
end
end
end
end
never mind the mysql error
Last edited by a moderator: