czempion
01-29-2020, 06:40 PM
Hello.
I have problem with detect Npc's in range 2
i try do that:
Module.New('Casino_Turn', function(Mod)
Gambler_Detected = false
if Creature.iNpcs(2) then
Gambler_Detected = true
else
Gambler_Detected = false
end
for name, creature in Creature.iPlayers(2) do
if (creature:Position().x == Self.Position().x + 2 and creature:Position().y == Self.Position().y and creature:Position().z == Self.Position().z) or (creature:Position().x == Self.Position().x - 2 and creature:Position().y == Self.Position().y and creature:Position().z == Self.Position().z) then
Gambler_Detected = true
end
Mod:Delay(100)
end
end)
But when no npc on screen still Gambler_Detected stay = true. How to fix it and doo gambler_detected when npc in range 2 is on screen?
I have problem with detect Npc's in range 2
i try do that:
Module.New('Casino_Turn', function(Mod)
Gambler_Detected = false
if Creature.iNpcs(2) then
Gambler_Detected = true
else
Gambler_Detected = false
end
for name, creature in Creature.iPlayers(2) do
if (creature:Position().x == Self.Position().x + 2 and creature:Position().y == Self.Position().y and creature:Position().z == Self.Position().z) or (creature:Position().x == Self.Position().x - 2 and creature:Position().y == Self.Position().y and creature:Position().z == Self.Position().z) then
Gambler_Detected = true
end
Mod:Delay(100)
end
end)
But when no npc on screen still Gambler_Detected stay = true. How to fix it and doo gambler_detected when npc in range 2 is on screen?