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

How to clone?

Asked by 10 years ago

I'm probably being a right idiot and making a huge fool of myself but I've been trying to fix this for days and it's still not working...

Player = game.Players.LocalPlayer
game.Players.PlayerAdded:connect(function (newPlayer)
    newPlayer.Changed:connect(function (property)
        if game.Players.LocalPlayer.TeamColor == BrickColor.new("Institutional white") then
            script.CoreGui:Clone().Parent = Player.PlayerGui
        end
    end)
end)

What it's meant to do is if you're on the "Institutional white" team or "Spectators" as the team is named, you get a script called "CoreGui" in your PlayerGui, and if you're on any other team your get a copy of the script CoreGui2.

0
Is this in a local script? lolguy951753 60 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

Use the Clone method its useful example:

local Part = script.Parent:Clone()
Part.Parent = game.Workspace
Ad
Log in to vote
-6
Answered by 10 years ago

Do Clone

0
epic answer greatneil80 2647 — 3y

Answer this question