Hello. I’m trying to make a healing spell in my game, that once you cast said spell, an area will be created where the mouse is and start healing Players that are on top of it. The part of creating the area is already done and working, the part that i’m having problem is the heal part, more specific, the area not detecting if there’s a Player on top of it.
Here’s the healing script:
for x = 1,5,1 do
task.wait(1)
local PlayersToHeal = HealZone:GetTouchingParts()
print(PlayersToHeal)
local PlayerHealed = {}
for y = 1,#PlayersToHeal,1 do
if PlayersToHeal[y].Parent:FindFirstChild("HumanoidRootPart") and not PlayersToHeal[y].Parent:FindFirstChild("HitBox") and not table.find(PlayerHealed, PlayersToHeal[y].Parent.Name) then
table.insert(PlayerHealed, PlayersToHeal[y].Parent.Name)
local PlayerHealing = game.Players:GetPlayerFromCharacter(PlayersToHeal[y].Parent)
local Health = PlayerHealing.Stats.Health
if Player.Element.Value == "Grass" then
Health.Value += (PlayerHealing.Level.Value/3)
else
Health.Value += (PlayerHealing.Level.Value/4)
end
end
end
end
There’s more to that code, but it’s not important. Well, when i run the game and step on top of this zone, it just don’t detect nothing.
Idk if the CanCollide should be active or not, either way this isn’t working, but when it’s active, it can detect the baseplate.