Im making a sun model and I want it to kill players and delete parts when they are near the sun but I dont know how to make a script that deletes parts when they touch the sun model. How do I do that?
Pretty simple, like what deth said, just like this:
1 | local Part = game.Workspace.Part |
2 |
3 | Part.Touched:Connect( function (hit) |
4 | hit:Destroy() |
5 | end ) |
or for player do
1 | local Part = game.Workspace.Part |
2 |
3 | Part.Touched:Connect( function (hit) |
4 | local Char = hit.Parent |
5 | if Char.Humanoid then |
6 | Char.Humanoid.Health = 0 |
7 | end |
8 | end ) |