Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Hit function Help?

So the hit function has this :

script.Parent.Touched:connect(function(hit)
end)

If the hit.Parent touches it,Then the part acesses its CHARACTER,How do i make it access the Player?

1 answer

✓ Accepted answer
script.Parent.Touched:connect(function(Part)
	local Char=Part.Parent
	if Char then
		local Player=game.Players:GetPlayerFromCharacter(Char)
		if Player then
			--Code goes here
		end
	end
end)

1 comment

0

Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.