Answered by
asgm 109
5 years ago
Check your code carefully, mistakes like this will be reduced as you get more experienced in coding.
1 | if hit.Name = = "REMOVER" then |
In this line, you want to define hit as REMOVER, which in case it is, the script goes on to line 3.
1 | local Player = game.Players:GetPlayerFromCharacter(hit.Parent) |
In this line, you must remember that REMOVER is now hit's parameter and thus hit.Parent is not krutik55, but instead the parent of REMOVER.
Solution:
1 | local Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent.Parent) |
Explanation: A tool is a descendant of a player when equipped.
(krutik55.Tool.Handle.Script), hence the 3 ".Parent"s