Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Capture Terminal will remain uncapurable aslong as there is someone on it. How to fix?

Asked by 6 years ago

Hello, a friend gave me a terminal to use for a fort that I am working on. It works great, however, I do have one issue with it.

Whenever someone dies, the terminal will be unable to be captured until their body has completely despawned. What's the best way to fix this issue?

        for i, obj in pairs(objects) do
            if obj.Parent:FindFirstChild("Humanoid") then
                local player = game.Players:GetPlayerFromCharacter(obj.Parent)
                if player.TeamColor == hostiles_color and valid == true then
                    if Progress.Value < 1 then
                        Progress.Value = Progress.Value + 0.0003
                    end
                elseif player.TeamColor == defenders_color and valid == true then
                    if Progress.Value > 0 then
                        Progress.Value = Progress.Value - 0.0003
                    end
                elseif config.AlliesCaptureAsDefenders.Value == true and player.TeamColor == allies_color and valid == true then
                    if Progress.Value > 0 then
                        Progress.Value = Progress.Value - 0.0003
                    end
                end
            end
        end
    end
end)
1
Why not check if their humanoid health is 0? UgOsMiLy 1074 — 6y

Answer this question