I'm trying to make a npc that despawns this is my script

local NPC = script.Parent.Parent

    wait(30)
    NPC:Destroy()

4 comments

0

What happens when you run the script?

0

When i run the script it stays in the game. But it's supposed to be removed

0

Make sure script.parent.parent isn't some random part and is the actual NPC.

0

Yep, if the script is in the NPC use script.Parent if the script is in another item then script.Parent.Parent