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

Clone Frame By TextButton Click?

Asked by 6 years ago

So Hello I want to make if player clicks the textbutton its will clone Frame From ReplicatedStorage To Gui. Attempt

1local Costume1 = game.ReplicatedStorage.Costume1
2 
3script.Parent.MouseButton1Click:Connect(function()
4game:GetService("ReplicatedStorage").Costume1:clone().Parent = game.Players

2 answers

Log in to vote
2
Answered by 6 years ago
Edited 6 years ago

Hi MrLordFearLT, you can use this instead of your current script. Also :clone() is deprecated use :Clone().

01-- Local Script
02 
03local NameGUI = "Costume1" -- Name of your GUI inside ReplicatedStorage.
04 
05local ReplicatedStorage = game:GetService("ReplicatedStorage")
06 
07local GUI = ReplicatedStorage:WaitForChild(NameGUI)
08 
09local Player =game.Players.LocalPlayer
10 
11function Clicked()
12local copy = GUI:Clone()
13copy.Parent = Player.PlayerGui
14end
15 
16script.Parent.MouseButton1Click:Connect(Clicked)
0
Approved! User#21499 0 — 6y
Ad
Log in to vote
-3
Answered by 6 years ago
Edited 6 years ago

Try this!

1Local Costume1  = game.ReplicatedStorage.Costume1
2script.Parent.MouseButton1Click:Connect(function()
3local clone = Costume1:Clone
4clone.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
5end)
0
Not that good at scripting but I tried. Lol WillBe_Stoped 71 — 6y
0
first line will make an error, lua is case sensitive. mixgingengerina10 223 — 6y
0
you realize when you downvote, you are basically losing reputation too...? greatneil80 2647 — 6y
0
this answer was rushed. Line 3 throws an error as well. User#19524 175 — 6y
View all comments (2 more)
0
Fail AswormeDorijan111 531 — 6y
0
Son i said im not good at scripting is having a go a crime or sum? why yall bein hella rude WillBe_Stoped 71 — 6y

Answer this question