Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does this Player NPC Removing dosen't work?

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

0

Could you edit in the script which creates the npc, as well?

0

Sure!

0

Added

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.