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

Clone is not a valid member of Workspace?.......PLEASE HELP

hello my problem is that if i clone somthing (line 3) it get cloned and get put in workspace but when i wanna use it (line 13) it says "GamerJanko's NPC is not a valid member of Workspace"

here is the script

     game.Lighting.Player.Archivable = true
	wait()
	local car = game.Lighting.Player:Clone()
	car.Name =  Player.Name.."'s NPC"
	car.Parent = game.Workspace	
	wait()		
	local selection = Instance.new("SelectionBox")
	selection.Color3 = Color3.new(0.6,0.6,0.6)
	selection.Transparency = 1
	selection.Name = Player.Name.."'s NPC"
	selection.Parent = game.Players.LocalPlayer.PlayerGui
	wait()
	selection.Adornee = game.Workspace(Player.Name.."'s NPC")

please help me

1 comment

0

On line 13, use " = game.Workspace[car.Name]"

1 answer

✓ Accepted answer

Simply, change line 13 to "selection.Adornee = game.Workspace[car.Name]"

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