Hey guys! I’m trying to get over this issue I have, it’s basically a hit script that will stun and take away health from the player; problem is, it stuns, but does not take away any health, making them walk away unharmed; besides being frozen. I don’t really know what to do besides what I have put here.
local hurtie = 30
script.Parent.Touched:Connect(function(touch)
touch.Parent.HumanoidRootPart.Anchored = true
wait(2)
touch.Parent.HumanoidRootPart.Anchored = false
local h = touch.Parent.Humanoid
h:TakeDamage(hurtie)
end)
local hurtie = 30
script.Parent.Touched:Connect(function(touch)
if touch and touch.Parent and touch.Parent:FindFirstChild("Humanoid") then
touch.Parent.HumanoidRootPart.Anchored = true
--takes damage before unfrozen
touch.Parent.Humanoid.Health -= 30
wait(2)
touch.Parent.HumanoidRootPart.Anchored = false
end
end)