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 » Scripting Helpers
Home Search
 

Re: 1 Team without GUI

Previous Thread :: Next Thread 
manofthesnakes is not online. manofthesnakes
Joined: 17 Aug 2010
Total Posts: 94
17 Jun 2014 04:56 PM
I have a fort, with 5 teams. There is a GUI allows you to change teams. One of those teams is the Prisoners team, that you go to if you surrender. I want to make it so the Prisoners team doesn't see the team switch GUI. Does anyone know how you would do that?
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
17 Jun 2014 05:02 PM
Put a local script in the starter GUI that repeatedly checks the player's TeamColor. (using a while true do loop)

If the color is the prisoner's teamcolor, then make the gui invisible, if the color
is anything else, make it visible.

The code would look something like this is pseudo code:

local prisoncolor = BrickColor.new(PrisonColor)
while true do
if game.Players.LocalPlayer.TeamColor == prisoncolor then
gui.Visible = false
else
gui.Visible = true
end



Report Abuse
manofthesnakes is not online. manofthesnakes
Joined: 17 Aug 2010
Total Posts: 94
17 Jun 2014 05:08 PM
It's saying there's a script error with this line

if game.Players.LocalPlayer.TeamColor == prisoncolor then
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
17 Jun 2014 05:12 PM
Is prisoncolor a BrickColor value? It should be
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
17 Jun 2014 05:12 PM
Wait ignore that lol
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
17 Jun 2014 05:13 PM
The error with that script is it's missing an end at the end.

while
if
end
--end needed
Report Abuse
manofthesnakes is not online. manofthesnakes
Joined: 17 Aug 2010
Total Posts: 94
17 Jun 2014 05:20 PM
local prisoncolor = BrickColor.new("Institutional white")
while true do
if game.Players.LocalPlayer.TeamColor == prisoncolor then
end
gui.Visible = false
else <-- Now the Error is there.
gui.Visible = true
end
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
17 Jun 2014 05:21 PM
local prisoncolor = BrickColor.new("Institutional white")
while true do
if game.Players.LocalPlayer.TeamColor == prisoncolor then
gui.Visible = false
else
gui.Visible = true
end
end
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
17 Jun 2014 05:21 PM
--You'll need a wait

local prisoncolor = BrickColor.new("Institutional white")
while true do
wait(1)
if game.Players.LocalPlayer.TeamColor == prisoncolor then
gui.Visible = false
else
gui.Visible = true
end
end
Report Abuse
manofthesnakes is not online. manofthesnakes
Joined: 17 Aug 2010
Total Posts: 94
17 Jun 2014 05:25 PM
So I put that in the StarterGui, or the GUI itself?
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
17 Jun 2014 05:27 PM
It doesn't matter.

As long as you define the 'gui' variable properly.
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
17 Jun 2014 05:28 PM
StarterGui
Report Abuse
manofthesnakes is not online. manofthesnakes
Joined: 17 Aug 2010
Total Posts: 94
17 Jun 2014 05:35 PM
So I would make this a Local Script, and put it in the Starter GUI?

local prisoncolor = BrickColor.new("Institutional white")
while true do
wait(1)
if game.Players.LocalPlayer.TeamColor == prisoncolor then
Change Team GUI For Manonian League.Visible = false
else
Change Team GUI For Manonian Leauge.Visible = true
end
end
Report Abuse
manofthesnakes is not online. manofthesnakes
Joined: 17 Aug 2010
Total Posts: 94
17 Jun 2014 05:36 PM
Also, there's a Script Error on this line.

Change Team GUI For Manonian League.Visible = false
Report Abuse
ZeroHour66 is not online. ZeroHour66
Joined: 14 Sep 2013
Total Posts: 1511
17 Jun 2014 05:42 PM
Try making the name something shorter and one word.
Like an abbreviation of that.
Report Abuse
manofthesnakes is not online. manofthesnakes
Joined: 17 Aug 2010
Total Posts: 94
17 Jun 2014 06:12 PM
Alright.
Report Abuse
manofthesnakes is not online. manofthesnakes
Joined: 17 Aug 2010
Total Posts: 94
17 Jun 2014 06:14 PM
It still isn't working, don't know why. Can one of you come in my PC to help me with this.
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
17 Jun 2014 07:45 PM
You didn't specify where it is exactly in your explorer. It is in the the starterGui so you you would put:

game.StarterGui
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
17 Jun 2014 07:46 PM
And then after that you would put a dot, and then the directory for where the GUI is in the starterGui
Report Abuse
manofthesnakes is not online. manofthesnakes
Joined: 17 Aug 2010
Total Posts: 94
17 Jun 2014 08:18 PM
I have done all of that, and it won't work still. Could one of you help me?
Report Abuse
manofthesnakes is not online. manofthesnakes
Joined: 17 Aug 2010
Total Posts: 94
17 Jun 2014 08:22 PM
I have put this script in my StarterGui.

local prisoncolor = BrickColor.new("Institutional white")
while true do
wait(1)
if game.Players.LocalPlayer.TeamColor == prisoncolor then
game.StarterGui.CTGUI.SwitchTeam.Visible = false
else
game.StarterGui.CTGUI.SwitchTeam.Visible = true
end
end
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
17 Jun 2014 08:26 PM
What does the output say?
Report Abuse
ZeroHour66 is not online. ZeroHour66
Joined: 14 Sep 2013
Total Posts: 1511
17 Jun 2014 08:27 PM
Yeah. Output can help deduct the problem.
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
17 Jun 2014 08:30 PM
Wait... I know what the problem is:

you are going to have to put in a variable that is like this:

local gui = game.Players.LocalPlayer.PlayerGui

then treat gui as the startergui
Report Abuse
manofthesnakes is not online. manofthesnakes
Joined: 17 Aug 2010
Total Posts: 94
17 Jun 2014 10:39 PM
And how would I add that to the script. To be honest, I'm a horrible scripter.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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