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

What's the difference between hit.Parent and part.Parent?[solved]

Asked by 9 years ago

Like

script.Parent.Touched:connect(function(hit)
    hit.Parent:findFirstChild("Torso")
end

vs

script.Parent.Touched:connect(function(part)
    part.Parent:findFirstChild("Torso")
end

Yes I did look it up http://gyazo.com/28ff4bffc4dbc02d6524ec28b0cd990c

2
There no Difference between these two, just the names, but they serve the same Job. woodengop 1134 — 9y
0
Ah, answer so i can give you points! Senor_Chung 210 — 9y
0
You can just press the arrow on the Left of his comment and he'll gain a point. alphawolvess 1784 — 9y
0
I tough that didn't work :l Senor_Chung 210 — 9y
0
@super, Ok, I'll post an answer. @ Alpha, the Upvote on the comments are only for recommendations. woodengop 1134 — 9y

1 answer

Log in to vote
2
Answered by
woodengop 1134 Moderation Voter
9 years ago

There are no Difference between hit, and part(just the names), But they serve the same job. Like lets say I named it kick Now lets try it out on Studio:

script.Parent.Touched:connect(function(kick)
    print(kick.Parent)
end)

--[ [OUTPUT] ] = Player

This can also be useful for getting the Players, Characters, Humanoid from kick(hit/part), You may ask, How do I get the Player From kick? Well there is a function that does that, It's called GetPlayerFromCharacter. This helps Users gain properties from the Player.

Ad

Answer this question