Need help with a script

Hello, so recently I have been trying how to script on https://developer.roblox.com/ (I think it’s called developer hub) and there was a course of creating a part that kills you once you touch it. And there are some parts of the course that ask to add this:



I didn’t add any more part, there is only one part. For what is that thing and how it works? Also it would work the script without that thing?

Any help is appreciated (Sorry for my ignorance)

1 Like

So this is simply using the Touched event. By default, Roblox passes the thing that touched the killing part which is the otherPart. However to kill a user we need to find it’s humanoid, and when a character touches a part it only passes the specified body part that touched the part not the humanoid so to get the humanoid we find the parent of it which is parentPart or the Character Model.

1 Like

Can you write any simple example please? I didn’t fully understand

otherpart is the part that touched the part with the script. For example, if a players Left leg touched the part with the script, otherpart would be equal to Left Leg, if that makes sense.

1 Like

So the otherPart it would be like the part that is touching the lava/part?

The other part is a param that the event gives you

and yes it is the part that touching the lava/part

1 Like