wyspJoin Date: 2008-08-05 Post Count: 78 |
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? |
|
wyspJoin Date: 2008-08-05 Post Count: 78 |
Oh yeah forgot to mention that this script is inside a imagebutton that's inside the surface gui. |
|
|
I hope script.Parent is a textbutton and not the gui itself?
VB.NET, C#, C++, PHP and much more |
|
wyspJoin Date: 2008-08-05 Post Count: 78 |
Yeah sorry I didnt add that, it's inside a imagebutton. |
|
|
wyspJoin Date: 2008-08-05 Post Count: 78 |
The surfacegui says the Adornee is blank. |
|
|
Uhm I copied your exact code and it works fine
VB.NET, C#, C++, PHP and much more |
|
|
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 |
|
|
Wait adornee is blank? Where is this gui located?
VB.NET, C#, C++, PHP and much more |
|
wyspJoin Date: 2008-08-05 Post Count: 78 |
Oh the surface gui is inside a brick. The brick is inside the workspace. |
|
|
^ and my previous question?
VB.NET, C#, C++, PHP and much more |
|
wyspJoin Date: 2008-08-05 Post Count: 78 |
Yes it is blank. |
|
wyspJoin Date: 2008-08-05 Post Count: 78 |
And roblox doesn't like img-ur. |
|
|
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 |
|
|
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 |
|
wyspJoin Date: 2008-08-05 Post Count: 78 |
Awesome man, thank you a lot. |
|
|
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 |
|
WrathsongJoin Date: 2012-07-05 Post Count: 22393 |
adornee |
|
|
@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 |
|
|
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? |
|
|
@bacon same reply I gave to wysp send me a picture of the explorer.
VB.NET, C#, C++, PHP and much more |
|
|
How can I send you the picture without getting modded for posting outside links (links other then roblox) |
|
|
Use dashes in the link
VB.NET, C#, C++, PHP and much more |
|
TimeTicksJoin Date: 2011-04-27 Post Count: 27115 |
use
http://prnt.sc/
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
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?
|
|