So Hello I want to make if player clicks the textbutton its will clone Frame From ReplicatedStorage To Gui. Attempt
1 | local Costume 1 = game.ReplicatedStorage.Costume 1 |
2 |
3 | script.Parent.MouseButton 1 Click:Connect( function () |
4 | game:GetService( "ReplicatedStorage" ).Costume 1 :clone().Parent = game.Players |
Hi MrLordFearLT
, you can use this instead of your current script. Also :clone() is deprecated use :Clone().
01 | -- Local Script |
02 |
03 | local NameGUI = "Costume1" -- Name of your GUI inside ReplicatedStorage. |
04 |
05 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
06 |
07 | local GUI = ReplicatedStorage:WaitForChild(NameGUI) |
08 |
09 | local Player = game.Players.LocalPlayer |
10 |
11 | function Clicked() |
12 | local copy = GUI:Clone() |
13 | copy.Parent = Player.PlayerGui |
14 | end |
15 |
16 | script.Parent.MouseButton 1 Click:Connect(Clicked) |
Try this!
1 | Local Costume 1 = game.ReplicatedStorage.Costume 1 |
2 | script.Parent.MouseButton 1 Click:Connect( function () |
3 | local clone = Costume 1 :Clone |
4 | clone.Parent = game.Players.LocalPlayer:WaitForChild( "PlayerGui" ) |
5 | end ) |