So Hello I want to make if player clicks the textbutton its will clone Frame From ReplicatedStorage To Gui. Attempt
local Costume1 = game.ReplicatedStorage.Costume1 script.Parent.MouseButton1Click:Connect(function() game:GetService("ReplicatedStorage").Costume1:clone().Parent = game.Players
Hi MrLordFearLT
, you can use this instead of your current script. Also :clone() is deprecated use :Clone().
-- Local Script local NameGUI = "Costume1" -- Name of your GUI inside ReplicatedStorage. local ReplicatedStorage = game:GetService("ReplicatedStorage") local GUI = ReplicatedStorage:WaitForChild(NameGUI) local Player =game.Players.LocalPlayer function Clicked() local copy = GUI:Clone() copy.Parent = Player.PlayerGui end script.Parent.MouseButton1Click:Connect(Clicked)
Try this!
Local Costume1 = game.ReplicatedStorage.Costume1 script.Parent.MouseButton1Click:Connect(function() local clone = Costume1:Clone clone.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui") end)