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

How can I damage my self if i pull out a item?

Asked by 2 years ago

How can I damage my self if i pull out a item?

2 answers

Log in to vote
0
Answered by 2 years ago

Hi i might of found something. Here is a devforum post about them having a bug where when they hold out a tool it damages them. Look at reply 2 where it shows a screenshot of his code this may help you. Devforum Hope this helps!!

0
Thanks Beelee12121 -2 — 2y
Ad
Log in to vote
0
Answered by 2 years ago

Use the .Equipped event and connect it to a function that damages the player. When a tool is equipped, its parent is always going to be the player's character, so you can form a reference that way. Here's an example:

local tool = script.Parent
tool.Equipped:Connect(function()
    tool.Parent.Humanoid:TakeDamage(100) -- change to your damage
end)
0
thanks Beelee12121 -2 — 2y

Answer this question