Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[EDIT] VERY simple give gui script works in Studio but not online?

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.

5 comments

0

No. This is clicking a part.

0

is it a local script?

0

No, does it have to be? I'll try it now.

0

With, or without a local script, it doesn't work.

0

There's a way to do it when you click a button you get it. I've done it.

2 answers

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

This discussion is preserved as it was. New answers, comments, and votes are closed.