Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
traigla 75
9 years ago

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.

0
No. This is clicking a part. traigla 75 — 9y
0
is it a local script? Bubbles5610 217 — 9y
0
No, does it have to be? I'll try it now. traigla 75 — 9y
0
With, or without a local script, it doesn't work. traigla 75 — 9y
0
There's a way to do it when you click a button you get it. I've done it. TypicalModerator 110 — 9y

2 answers

Log in to vote
0
Answered by 9 years ago

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.

Ad
Log in to vote
-2
Answered by 9 years ago

you would do

script.Parent.MouseButton1Down:connect(function()
    --code in here
end)

but this is if the sript is inside a textbutton or imagebutton

Answer this question