menu
Roblox Forum Archive
Home
User Search
Forums
Donate
search
settings
Home
User Search
Forums
Donate
launch
Go to User Dashboard
Forums
Scripters
What does hit refer to?
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right
What does hit refer to?
Talaias
Join Date: 2013-06-21
Post Count: 973
#158981562
Monday, March 30, 2015 9:15 PM GMT
Like in onTouch functions.
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
Seranok
Join Date: 2009-12-12
Post Count: 11083
#158981623
Monday, March 30, 2015 9:15 PM GMT
local part = Instance.new("Part") part.Parent = workspace part.Touched:connect(function(hit) -- hit is another part which collided with this one end)
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
distalDigitPhalanx
Join Date: 2015-01-25
Post Count: 1509
#158991563
Monday, March 30, 2015 11:04 PM GMT
You could call it whatever, though
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
Talaias
Join Date: 2013-06-21
Post Count: 973
#159808338
Friday, April 10, 2015 12:37 AM GMT
So basically. If it hit the player, torso for example. Torso.Parent.Parent would bring me to the LocalPlayer?
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
ShadowAley
Join Date: 2010-06-23
Post Count: 4823
#159810704
Friday, April 10, 2015 1:06 AM GMT
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then -- if a player hit this it would give you the player's character local plr = game.Players:GetPlayerFromCharacter(hit.Parent) end)
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right