generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: why wont this work

Previous Thread :: Next Thread 
Dad_Bot is not online. 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 is online. 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 is not online. 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 is not online. 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 is not online. yin_yang
Joined: 24 Feb 2016
Total Posts: 537
17 Jul 2017 05:26 PM
serverscriptservice
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
17 Jul 2017 05:26 PM
ServerScriptService


Report Abuse
Dad_Bot is not online. 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 is not online. Dad_Bot
Joined: 27 Jun 2011
Total Posts: 917
17 Jul 2017 05:27 PM
keep it local or no?


Report Abuse
yin_yang is not online. 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 is not online. Dad_Bot
Joined: 27 Jun 2011
Total Posts: 917
17 Jul 2017 05:28 PM
got it to work! thanks all.


Report Abuse
LaeMVP is online. 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
TheArturZh is not online. TheArturZh
Joined: 01 Feb 2014
Total Posts: 34
17 Jul 2017 05:33 PM
@LaeMVP this will not work because you can't access ServerStorage from LocalScript.
Report Abuse
LaeMVP is online. 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 is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
17 Jul 2017 05:38 PM
That's not how it works.


Report Abuse
LaeMVP is online. LaeMVP
Joined: 24 Jun 2013
Total Posts: 4416
17 Jul 2017 05:46 PM
wot?
Report Abuse
TimeTicks is not online. 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 is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
17 Jul 2017 05:49 PM
Wrong thread.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image