local Part = script.Parent
while true do wait()
local Check = workspace:GetPartsInPart(Part)
local Active = true
for i, v in ipairs(Check) do
if v.Parent:FindFirstChildOfClass("Humanoid") then
local Humanoid = v.Parent:FindFirstChild("Humanoid")
if v.Name == "HumanoidRootPart" or Humanoid then
local Player = game.Players:GetPlayerFromCharacter(v.Parent)
local Damage = Player:WaitForChild("DamageActive")
if Damage then
if Damage.Value == true then
Active = false
game.Players:GetPlayerFromCharacter(v.Parent).DamageActive.Value = Active
v.Parent.Humanoid:TakeDamage(25)
print("Hit")
wait(1)
Active = true
if Damage then
Damage.Value = Active
end
elseif Damage.Value == false then
wait(1)
Damage.Value = true
end
end
end
end
end
end
local Part = script.Parent
while true do wait()
local Check = workspace:GetPartsInPart(Part)
local Active = true
for i, v in ipairs(Check) do
if v.Parent then
local Humanoid = v.Parent:FindFirstChild("Humanoid")
if Active then
Active = false
v.Parent.Humanoid:TakeDamage(25)
wait(1)
end
end
end
end
At first I thought that the “Active” being in the script is the reason why if there’s more than 1 Character touching the Part, it only damages 1 Character and the other Character will only be able to take damage if the other Character is removed from the Part. ← That is the problem I’m having. Also I don’t want to use Part.Touched
as it’s inconsistent. Y’all got any idea how to solve this problem?
Pwease help