I've been trying to clone a Gui from ServerStorage to the PlayerGui using a LocalScript for the past hour or so. The script seems fine; there's no output errors, and it should be working. I've done this script a little while back, but I'm not sure if a ROBLOX error is causing this, or if something about my script is a tad off.
local Player = game.Players.LocalPlayer local ClickDetector = script.Parent.ClickDetector local Gui = game.ServerStorage["Supplier Menu"] ClickDetector.MouseClick:connect(function() local a = Gui:Clone() a.Parent = Player.PlayerGui end)
Cheers in advance for any help.
Localscripts
cannot access ServerStorage
, use ReplicatedStorage
instead.
local Player = game.Players.LocalPlayer local ClickDetector = script.Parent.ClickDetector local Gui = game.ReplicatedStorage["Supplier Menu"] -- Remember to place 'Supplier Menu` in ReplicatedStorage ClickDetector.MouseClick:connect(function() local a = Gui:Clone() a.Parent = Player.PlayerGui end)