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

why is show_room model not copying?

Asked by 3 years ago

i ma trying to make it so that when the player spawns show room model will copy and move

local show_room = script.Parent
local copy = show_room:Clone()

function new_child(child)
    if child.p_or_o.Value == "player" then
        copy:MoveTo(Vector3.new(show_room.camera_part.Position.X + 10))
        copy.Name = child.Name .. "'s spawn"
    end
end

game.Workspace.ChildAdded:Connect(new_child)
0
I believe ChildAdded is deprecated consider changing it. JesseSong 3916 — 3y

1 answer

Log in to vote
1
Answered by
JesseSong 3916 Moderation Voter Community Moderator
3 years ago
Edited 3 years ago

You forgot to parent it to the thing you want it to be in. All you have to do is write on line 2.

Replace the code with line 2

local copy = show_room:Clone().Parent = workspace -- where you want it to clone

If my answer helped, make sure to upvote and accept

~JesseSong

Ad

Answer this question