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

How do I make it so it doesn't hurt the user that uses it? [closed]

Asked by 6 years ago
script.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") ~= nil then
        hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 20
        script.Parent:Destroy()
    end
end)
0
Get the player using it and have an if statement that checks if it is or isn't that player Viking359 161 — 6y
0
I can get the player by their UserId but I dont know how to check the UserId with the Player DrDeath_GamingYT 2 — 6y
0
+1 to omit moderation rep loss Goulstem 8144 — 6y

Closed as Non-Descriptive by Goulstem

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?