|
Using MouseButton1Click in a regular server script in a SurfaceGui>TextButton.
I need a redirection to the player, how should I do this
separate local script with client-sided handling?
|
|
|
You can always put it in startergui and use a localscript
http://www.roblox.com/unnamed-item?id=385096183 Ready to waste a ton of money of VR tech for Sword Art Online : The Beginning |
|
DrSaintJoin Date: 2009-10-14 Post Count: 18429 |
Use StarterGUI and localscripts and just adorn the surfacegui
|
|
|
yeah, thought so as well.
|
|
|
@Dr How does adorning the SurfaceGui even help?
It just attaches it to the part.
|
|
|
....? You're practically "adorning" it when you place it in a part
http://www.roblox.com/unnamed-item?id=385096183 Ready to waste a ton of money of VR tech for Sword Art Online : The Beginning |
|
DrSaintJoin Date: 2009-10-14 Post Count: 18429 |
Because you're going to use localscripts in startergui for a SurfaceGui.
|
|
|
|
works fine.
workspace.Part.SurfaceGui.TextButton.MouseButton1Click:connect(function()
end)
works fine without defining its adornee..?
|
|
DrSaintJoin Date: 2009-10-14 Post Count: 18429 |
I thought you were going to use local scripts inside the SurfaceGUI inside StarterGui to get the player redirection. Woopsie lol.
|
|
|
LocalScripts inside surfacegui's?
in other words, LocalScripts inside workspace?
http://wiki.roblox.com/index.php?title=API:Class/LocalScript
"A LocalScript will only run Lua code if it is a descendant of one of the following objects:
A Player's Backpack, such as a child of a Tool
A Player's Character model
A Player's PlayerGui
A Player's PlayerScripts
The ReplicatedFirst service"
|
|
DrSaintJoin Date: 2009-10-14 Post Count: 18429 |
@Synth
What? Lol
|
|
|
You were assuming I'm using localscripts in workspace o3o
|
|
DrSaintJoin Date: 2009-10-14 Post Count: 18429 |
OH. Yea I was LOOL.
What's the set up right now?
|
|
|
You asked for a way to do a redirection to a player use a localscript and the player = game.Players.LocalPlayer
http://www.roblox.com/unnamed-item?id=385096183 Ready to waste a ton of money of VR tech for Sword Art Online : The Beginning |
|
|
Ya I know
repeat wait() until game.Players.LocalPlayers and game.Players.LocalPlayers.Character
local myPlr, myChar = game.Players.LocalPlayer,game.Players.LocalPlayer.Character
I got that,
was just wondering if I could redirect from SurfaceGui Server scripts.
|
|
DrSaintJoin Date: 2009-10-14 Post Count: 18429 |
Ah ok. No, you can't. :c
|
|
|
Setup is:
Workspace
>Part
>>SurfaceGUI
>>>TextButton
>>>>Script
StarterGui
>LocalScript
|
|
DrSaintJoin Date: 2009-10-14 Post Count: 18429 |
Yea can't do that. Gotta have the LocalScript inside the gui.
|
|