i am trying to make a game were you are clicking to make a frame (very weird) and i am trying to make that it would copy the frame from server storage and paste it into starter gui but it dosent work if u have any solution let me know
local Players = game:GetService("Players") local player = Players.LocalPlayer local mouse = player:GetMouse() local Object = game.ServerStorage.Dot local copy = Object:Clone() mouse.Button1Down:Connect(function() copy = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame copy.Position = UDim2.new(0,mouse.X - 10, 0,mouse.Y + 25 ) end)
You should put your copy clone variable in the function so every time you click, it clones it instead of cloning ONLY ONCE
local Players = game:GetService("Players") local player = Players.LocalPlayer local mouse = player:GetMouse() local Object = game.ServerStorage.Dot mouse.Button1Down:Connect(function() local copy = Object:Clone() copy.Parent = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame copy.Position = UDim2.new(0,mouse.X - 10, 0,mouse.Y + 25 ) end)
You also instead of defining copy clone's Parent, you instead redefined the copy variable as an Instance location. Hope that solves your issue! :)
Seems like you forgot to add ".Parent" in line 9
copy.Parent = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame
But if u need to copy your object more than once, u have to put
local copy = Object:Clone()
into function.