it’s a table, but its been fixed now
local rns=game:GetService("RunService")
while true do
for _, thing in ipairs(things) do
local h = thing:FindFirstChildWhichIsA("Humanoid")
if not h or h.Health <= 0 then continue end
local p = game.Players:GetPlayerFromCharacter(thing)
if p then playerturn(thing) else enemyturn(thing) end
end rns.Stepped:Wait()
end
how would i end the loop while it’s iterating over an enemy that’s already attacking, im using bindablefunctions to tell the enemy to attack
Please clean up your code, this is tragic
local RunService = game:GetService("RunService")
while true do
for _, thing in ipairs(things) do
local humanoid = thing:FindFirstChildWhichIsA("Humanoid")
if not humanoid or humanoid.Health <= 0 then
continue
end
local player = game.Players:GetPlayerFromCharacter(thing)
if player then
playerturn(thing)
else
enemyturn(thing)
end
end
RunService.Stepped:Wait()
end
1 Like