Xephyric
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 2270 |
|
|
| 15 Dec 2013 02:30 PM |
script.Parent.Claim.MouseButton1Down:connect(function(p) end
How can I get the player from p? (Making a variable to define the name or object of the player)
The reason I need this is because this is in a SurfaceGui that everyone can see, so it is not a localscript, hence, "game.Players.LocalPlayer" does not work |
|
|
| Report Abuse |
|
|
Lepado12
|
  |
| Joined: 19 Sep 2009 |
| Total Posts: 3931 |
|
|
| 15 Dec 2013 02:31 PM |
local p = Workspace.Player
Tried that? |
|
|
| Report Abuse |
|
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 15 Dec 2013 02:32 PM |
nonono
.MouseButton1Down:connect(function(x, y)
-- x and y would be the mouse coordinates
You'd have to get to the player with script.Parent.Parent.Parent etc etc |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2013 02:32 PM |
That sets a very bad problem. Because you need a local script ran on the player to make the buttons not be clickable by other people. Another alternative is to make it not seeable and instead put it in their playergui, but there isnt really a way to get the player from MouseButton1Down. |
|
|
| Report Abuse |
|
|
Xephyric
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 2270 |
|
|
| 15 Dec 2013 02:34 PM |
I want this gui to be able to be seen by all players, not locally. It is under workspace |
|
|
| Report Abuse |
|
|
| |
|
Xephyric
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 2270 |
|
|
| 15 Dec 2013 02:35 PM |
@Lepado What would that do? |
|
|
| Report Abuse |
|
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 15 Dec 2013 02:35 PM |
Impossible? wat
if you put the gui in StarterGui, everyone'd get it what's the problem here really |
|
|
| Report Abuse |
|
|
Xephyric
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 2270 |
|
|
| 15 Dec 2013 02:36 PM |
@getkoed
Everyone would see different instances of it, and would not be showing the same things to all the players |
|
|
| Report Abuse |
|
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 15 Dec 2013 02:36 PM |
| Well then get a script that updates it so everyone gets to see the same stuff :c |
|
|
| Report Abuse |
|
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 15 Dec 2013 02:37 PM |
Oh wait, surfacegui :U lemme think now |
|
|
| Report Abuse |
|
|
Xephyric
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 2270 |
|
|
| 15 Dec 2013 02:38 PM |
Also, take this into consideration. This gui needs to be able to interact with workspace, changing things that are not local. So it can't be a localscript |
|
|
| Report Abuse |
|
|
Quorum
|
  |
| Joined: 25 Oct 2013 |
| Total Posts: 4680 |
|
|
| 15 Dec 2013 02:39 PM |
| Still not an excuse to shoot down a script which replicates all of the changes to all players, considering you can use RemoteFunctions if you really need to communicate between server side and client side scripts. |
|
|
| Report Abuse |
|
|
Xephyric
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 2270 |
|
|
| 15 Dec 2013 02:41 PM |
@Quorum I don't understand what you're saying e.e |
|
|
| Report Abuse |
|
|
holden169
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 185 |
|
|
| 01 Apr 2014 05:47 AM |
Well.... game.Workspace:FindFirstChild(p.Name) Or game.Players:FindFirstChild(p.Name) |
|
|
| Report Abuse |
|
|
Geodesic
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 998 |
|
|
| 01 Apr 2014 05:52 AM |
....seriously guys localscript in startergui will work
local player = game.Players.LocalPlayer local surfacegui = Workspace.Part.SurfaceGui
surfacegui.TextButton.MouseButton1Click:connect(function() print(player.Name..' clicked the button') end) |
|
|
| Report Abuse |
|
|