Currently I am using a raycast module by TeamSwordphin, and I am trying to make this spin attack only damage a humanoid once it has been hit, then a little after, so the attack would not be in their hitbox anymore, until it comes back around.
newHitbox.OnHit:Connect(function(hit)
print(hit)
print(hit.Parent)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hit.Parent.Name == game.Players:FindFirstChild(hit.Parent.Name) then
elseif hum and hit.Parent.Name ~= game.Players:FindFirstChild(hit.Parent.Name) then
local tag = Instance.new("IntValue")
tag.Name = "tag"
tag.Parent = hum
if tag.Value == 0 or tag.Value == nil then
tag.Value = 1
hum:TakeDamage(50)
wait(.1)
tag:Destroy()
end
The problem I'm finding is that this seems unreliable. A problem that this may or may not cause is that not moving makes this not even fire, but also sometimes when I am moving, it just doesn't work. Any advice is helpful.
