So basically, let's say when I hit a part, and its my right leg, is there a way i can make it print the location, eg:
OUTPUT: game.Players.PlayerName.Humanoid.RightLeg
So basically, let's say when I hit a part, and its my right leg, is there a way i can make it print the location, eg:
OUTPUT: game.Players.PlayerName.Humanoid.RightLeg
supa dupa simple
script.Parent.Touched:Connect(function(hit)
print(hit:GetFullName())
end)
Thanks, also thnx to others for trying to help, i accepted ur answer as you provided an example
Try this: Parent the script under the detection part
local detectPart = script.Parent
detectPart.Touched:Connect(function(part)
if part then
if part.Parent:FindFirstChild("Humanoid") or part.Parent.Parent:FindFirstChild("Humanoid") then
print(part.Position)
end
end
end)
I don't understand how the part's parent's parent could be the player's character. Other than that, I agree with your answer.
Really easy to do! This script that I made down below checks if whatever touches the part is a humanoid (player) and prints what has touched the part.
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
print(hit.Name .." has touched the part")
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
You can try :GetFullName()