|
| 29 Apr 2014 07:50 PM |
script.Parent.MouseButton1Down:connect(function() for _,v in ipairs(game.Players:GetPlayers()) do wait() local z = game.ReplicatedStorage.Screen:Clone() local pd = v:FindFirstChild("PlayerGui") if pd then z.Parent = pd end end end)
When I try to insert the item into the PlayerGui of other players, it won't allow it. For some reason no player's PlayerGui other than the button presser's can be accessed....any ideas for how to get around this? |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 29 Apr 2014 07:55 PM |
script.Parent.MouseButton1Down:connect(function() for i,v in pairs(game.Players:GetChildren()) do game.ReplicatedStorage:FindFirstChild("Screen")Clone().Parent = v:FindFirstChild("PlayerGui") end end) |
|
|
| Report Abuse |
|
|
Exus100
|
  |
| Joined: 11 Aug 2007 |
| Total Posts: 351 |
|
|
| 29 Apr 2014 07:58 PM |
script.Parent.MouseButton1Down:connect(function() print(#game.Players:GetPlayers()) for _,v in ipairs(game.Players:GetPlayers()) do wait() local z = game.ReplicatedStorage.Screen:Clone() print(z) local pd = v:FindFirstChild("PlayerGui") print(pd) if pd then z.Parent = pd end end end)
tell me output |
|
|
| Report Abuse |
|
|
|
| 29 Apr 2014 08:03 PM |
-- Screen PlayerGui ... --
That's the reason I used FindFirstChild("PlayerGui") so that it wouldn't error saying;
21:02:47.607 - PlayerGui is not a valid member of Player |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 04 May 2014 01:45 PM |
| If this is in a LocalScript then that is your problem. A client can only access its own PlayerGui. |
|
|
| Report Abuse |
|
|