This works in Studio, but not online in play mode, any help?
local gui = script.Parent.Training script.Parent.Part.ClickDetector.MouseClick:connect(function(plr) local newgui = gui:Clone() newgui.Parent = plr.PlayerGui end)
Edit: The solution was I had FilteringEnabled set to true and it's false now and works.
Make sure everything is where it should be. Put the Gui inside of the script. Make it a Server Script (regular script).
script.Parent.ClickDetector.MouseClick:connect(function(Player) script.Training:Clone().Parent = Player.PlayerGui end)
Nothing really different. Just be sure to put the script and ClickDetector inside of the part, and the Gui in the script.
you would do
script.Parent.MouseButton1Down:connect(function() --code in here end)
but this is if the sript is inside a textbutton or imagebutton