So i am working on this game called survive freddy and i noticed that there is a problem when freddy walks into the office he cant leave and he stays there killing everyone and they have to rejoin a new server to fix it. So i was wandering how do i put a script in the door enteryway where when he touches the part that is in the enteryway it kills him after 10 seconds but it does not kill the players playing the game. Please answer. Thanks!
This should work:
script.Parent.Touched:Connect(function(hit) if hit.Parent.Name == "[Your NPC Name]" then wait(10) hit.Parent:Destroy() end end)
But I don't recommend doing it this way. This is just an example. A better way would be to put like a Boolean Value in the NPC and make the touched function find the Boolean value.
Closed as Not Constructive by JakyeRU, namespace25, and BlueTaslem
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?