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

How to clone?

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.

1 comment

0

Is this in a local script?

2 answers

✓ Accepted answer

Use the Clone method its useful example:

local Part = script.Parent:Clone()
Part.Parent = game.Workspace

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