So I made an NPC, so when he dies he is supposed to reward the player who killed him 50 cash, but the thing is, how do you find the player?
Target = script.Parent.Value
Me = script.Parent.Parent
RS = script.Parent["Right Shoulder"]
Safe = {"ComputerComplexity"}
script.Parent.Parent.Humanoid.WalkSpeed = 10
function Follow(Part)
if Part.Parent:FindFirstChild("Humanoid") ~= nil then
Target.Value = Part.Parent.Name
for i = 1, 20 do
Me.Humanoid:MoveTo(Part.Parent.Torso.Position, Part.Parent.Torso)
wait(0.025)
end
end
end
function Punch(Hit)
for i = 1, 10 do
end
end
script.Parent.Touched:connect(Follow)
script.Parent.Touched:connect(Punch)
