Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would I go by making a script for a no - damage zone?

Asked by 3 years ago

I have tried to write gear removers but they haven't worked. I wanna know how i would go by making a block that would make it so that you can't deal any damage with a sword.

1 answer

Log in to vote
0
Answered by
MattVSNNL 620 Moderation Voter
3 years ago

Try this

Add a script into the part

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.Humanoid.MaxHealth = math.huge
        hit.Parent.Humanoid.Health = hit.Parent.Humanoid.MaxHealth
    end
end)

script.Parent.TouchEnded:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.Humanoid.MaxHealth = 100
        hit.Parent.Humanoid.Health = hit.Parent.Humanoid.MaxHealth
    end
end)
0
Thanks! I'll try that. epic_hen9 27 — 3y
0
:) MattVSNNL 620 — 3y
Ad

Answer this question