I've been trying to make a fully anchored character take damage.
My touched script:
script.Parent.Touched:Connect(function(p)
if p and script.Parent.CanDamage.Value == true and script.Parent.Parent.Parent.Name ~= p.Parent.Name and p.Parent:FindFirstChild("Humanoid") ~= nil then
script.Parent.CanDamage.Value = false
local scc = script.TakeDamage:Clone()
scc.Parent = p.Parent
scc.Disabled = false
end
end)
(Another script refreshes the value to true again after a certain amount of time)
The TakeDamage script:
repeat wait() until script.Parent.HumanoidRootPart.Anchored == false
wait(0.1)
script.Parent.Humanoid:TakeDamage(6)
script:Remove()
