Dad_Bot
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 917 |
|
|
| 17 Jul 2017 05:21 PM |
admins = {"Dad_Bot","Kid_Bot"}
game:GetService("Players").PlayerAdded:connect(function(plr) for _,v in pairs(admins) do if plr.Name == v then
local panel = game:GetService("ServerStorage"):FindFirstChild("GoldStarGUI"):Clone() panel.Parent = plr.PlayerGui panel.adminPanelScript.Disabled = false
end end end)
I put the GUI in ServerStorage and the localscript in workspace. Why won't this work?
|
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 17 Jul 2017 05:23 PM |
local Admins = { [YourUserId] = true; } game.Players.PlayerAdded:Connect(function(plr) if Admins[plr.UserId] then local panel = game.ServerStorage:FindFirstChild("GoldStarGUI"):Clone() panel.Parent = plr.PlayerGui panel.adminPanelScript.Disabled = false end end)
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 17 Jul 2017 05:23 PM |
It needs to be a server script
|
|
|
| Report Abuse |
|
|
Dad_Bot
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 917 |
|
|
| 17 Jul 2017 05:25 PM |
Does the script remain in workspace as a regular script (non-local)? Or do I put it somewhere specific?
|
|
|
| Report Abuse |
|
|
yin_yang
|
  |
| Joined: 24 Feb 2016 |
| Total Posts: 537 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
Dad_Bot
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 917 |
|
|
| 17 Jul 2017 05:26 PM |
@Lae is your script local or no? where do I put the script?
|
|
|
| Report Abuse |
|
|
Dad_Bot
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 917 |
|
| |
|
yin_yang
|
  |
| Joined: 24 Feb 2016 |
| Total Posts: 537 |
|
|
| 17 Jul 2017 05:28 PM |
| why would u want it to be local? :l |
|
|
| Report Abuse |
|
|
Dad_Bot
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 917 |
|
|
| 17 Jul 2017 05:28 PM |
got it to work! thanks all.
|
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 17 Jul 2017 05:28 PM |
You really should be cloning the gui from the client, something like; local Admins = { [YourUserId] = true; } local Player = game.Players.LocalPlayer if Admins[Player.UserId] then local panel = game.ServerStorage:FindFirstChild("GoldStarGUI"):Clone() panel.Parent = Player.PlayerGui panel.adminPanelScript.Disabled = false end
Putting that in a local script and it should work with FE |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2017 05:33 PM |
| @LaeMVP this will not work because you can't access ServerStorage from LocalScript. |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 17 Jul 2017 05:37 PM |
| That's why you put the LocalScript somewhere it'll run. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 17 Jul 2017 05:47 PM |
You don't put an error statement like that. e.e
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|