of     1   

wysp
#170525960Sunday, August 09, 2015 4:25 PM GMT

local function action() print("Test") end script.Parent.MouseButton1Click:connect(action) This function works in the playergui but not in the surfacegui that's in a brick. Is there something different I have to do to get it to work?
wysp
#170526454Sunday, August 09, 2015 4:30 PM GMT

Oh yeah forgot to mention that this script is inside a imagebutton that's inside the surface gui.
FloweryMonkeyboy5
#170526456Sunday, August 09, 2015 4:30 PM GMT

I hope script.Parent is a textbutton and not the gui itself? VB.NET, C#, C++, PHP and much more
wysp
#170526546Sunday, August 09, 2015 4:31 PM GMT

Yeah sorry I didnt add that, it's inside a imagebutton.
iamsmartcookie
#170526633Sunday, August 09, 2015 4:32 PM GMT

Adornee
wysp
#170526743Sunday, August 09, 2015 4:34 PM GMT

The surfacegui says the Adornee is blank.
FloweryMonkeyboy5
#170526796Sunday, August 09, 2015 4:34 PM GMT

Uhm I copied your exact code and it works fine VB.NET, C#, C++, PHP and much more
FloweryMonkeyboy5
#170526955Sunday, August 09, 2015 4:36 PM GMT

Some of the properties of your imagebutton must be messed up. Can you make a screenshot of the full properties and paste it? VB.NET, C#, C++, PHP and much more
FloweryMonkeyboy5
#170527125Sunday, August 09, 2015 4:38 PM GMT

Wait adornee is blank? Where is this gui located? VB.NET, C#, C++, PHP and much more
wysp
#170527463Sunday, August 09, 2015 4:42 PM GMT

Oh the surface gui is inside a brick. The brick is inside the workspace.
FloweryMonkeyboy5
#170527784Sunday, August 09, 2015 4:45 PM GMT

^ and my previous question? VB.NET, C#, C++, PHP and much more
wysp
#170527817Sunday, August 09, 2015 4:46 PM GMT

Yes it is blank.
wysp
#170527929Sunday, August 09, 2015 4:47 PM GMT

And roblox doesn't like img-ur.
FloweryMonkeyboy5
#170530327Sunday, August 09, 2015 5:11 PM GMT

Alright I found your problem. You are using a localscript. Localscripts only run inside of the player's model inside the players folder. If you put a localscript inside the workspace it will refuse to run. Changing the localscript to a normal script wouldn't work either because then you wouldn't be able to retrieve who clicked the button. Instead what you have to do is to place the localscript and the entire surfacegui into the StarterGui folder. Then when the localscript starts to run do this. script.Parent.Parent.Adornee = --brick to attach to VB.NET, C#, C++, PHP and much more
FloweryMonkeyboy5
#170530436Sunday, August 09, 2015 5:12 PM GMT

This way you can do what you want when still being able to access the current player who clicked it(if you need it) VB.NET, C#, C++, PHP and much more
wysp
#170533963Sunday, August 09, 2015 5:44 PM GMT

Awesome man, thank you a lot.
Bacon0verLord
#170560005Sunday, August 09, 2015 9:56 PM GMT

Hey so, I'm wondering how to do the same thing, if I take the surfacegui out of the part and put it into playergui, does it dissappear from the brick? or would setting the adornee put it right back, cause if it does put it right back, im doing something wrong cause it didnt show up when i did it
Wrathsong
#170560344Sunday, August 09, 2015 9:59 PM GMT

adornee
FloweryMonkeyboy5
#170654087Monday, August 10, 2015 5:31 PM GMT

@bacon in your localscript that you bring with the gui in the startergui folder. Set in the first line the adornee to the brick VB.NET, C#, C++, PHP and much more
Bacon0verLord
#170670094Monday, August 10, 2015 8:16 PM GMT

Not sure whats wrong, output isnt saying anything, this is my code: script.Parent.Adornee=game.Workspace.Monitor.Screen script.Parent=game.Players.LocalPlayer.PlayerGui script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.StartmenuBG.Visible=true end) I've got this in a localscript that is the child of a textbutton which is the child of a surfacegui, what am I doing wrong?
FloweryMonkeyboy5
#170767305Tuesday, August 11, 2015 3:13 PM GMT

@bacon same reply I gave to wysp send me a picture of the explorer. VB.NET, C#, C++, PHP and much more
Bacon0verLord
#170774230Tuesday, August 11, 2015 4:25 PM GMT

How can I send you the picture without getting modded for posting outside links (links other then roblox)
FloweryMonkeyboy5
#170874482Wednesday, August 12, 2015 10:26 AM GMT

Use dashes in the link VB.NET, C#, C++, PHP and much more
TimeTicks
#170875015Wednesday, August 12, 2015 10:40 AM GMT

use http://prnt.sc/ "Talk is cheap. Show me the code." - Linus Torvalds
Bacon0verLord
#170890568Wednesday, August 12, 2015 3:20 PM GMT

I tried taking a screenshot using hypercam 2 since roblox screenshots only take pictures of the game area, not all of studio but it didnt work, any ideas?

    of     1