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?
✓ ANSWER ACCEPTED
How can I make a script that delets parts?
1 answer
✓ Accepted answer
Pretty simple, like what deth said, just like this:
local Part = game.Workspace.Part
Part.Touched:Connect(function(hit)
hit:Destroy()
end)
or for player do
local Part = game.Workspace.Part
Part.Touched:Connect(function(hit)
local Char = hit.Parent
if Char.Humanoid then
Char.Humanoid.Health = 0
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
You would have to do a .touched event for the part that activates the script and then to delete parts you target the part and do :Destroy()
Thanks