So Recently I started Making a game and I made a working NPC Spawning when the player joins but when he leaves his npc still stays there So.. I made a removing script for it aswell but it does not work can someone help me here:
Working Part:
local npc = game.ServerStorage.NPC
game.Players.PlayerAdded:connect(function(plr)
npc:clone().Parent = game.Workspace
wait(0.1)
local npcr = game.Workspace.NPC
npcr.Name = plr.Name..' Figure'
end)
Broken Part:
game.Players.PlayerRemoving:connect(function(plr)
local npcremove = game.Workspace[plr.Name..' Figure']
npcremove:Destory()
end)

3 comments
Could you edit in the script which creates the npc, as well?
Sure!
Added