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

How do I make it the players damaged when it touches a certain block ?

Asked by 10 years ago

Well the title basically explains what I need to know...

3 answers

Log in to vote
0
Answered by
gskw 1046 Moderation Voter
10 years ago

Put in a regular script inside the brick.

script.Parent.OnTouched:connect(function(p)
    if p.Parent.Humanoid~=nil then
        p.Parent.Humanoid.Health=p.Parent.Humanoid.Health-20 -- Can be any damage you want
    end
end)
Ad
Log in to vote
0
Answered by
yurhomi10 192
10 years ago

try this

script.Parent.Touched:connect(function(hit)
human = hit.Parent:FindFirstChild("Humanoid")
if human then
human:TakeDamage(5)
end
end)
Log in to vote
0
Answered by 10 years ago

Thanks both of you guys for your scripts this has also teached me some scripting

Answer this question