Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this Player NPC Removing dosen't work?

Asked by 8 years ago

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)
0
Could you edit in the script which creates the npc, as well? Pyrondon 2089 — 8y
0
Sure! LordDamionDevil 0 — 8y
0
Added LordDamionDevil 0 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

is PlayerRemoving even a thing?

0
Yes it is.. LordDamionDevil 0 — 8y
Ad

Answer this question