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

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

Asked by 5 years ago
Edited 5 years ago

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

0
On line 13, use " = game.Workspace[car.Name]" User#28017 0 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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

Ad

Answer this question