|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 17 Jun 2014 05:12 PM |
| Is prisoncolor a BrickColor value? It should be |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 17 Jun 2014 05:25 PM |
| So I put that in the StarterGui, or the GUI itself? |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 17 Jun 2014 05:42 PM |
Try making the name something shorter and one word. Like an abbreviation of that. |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 17 Jun 2014 08:27 PM |
| Yeah. Output can help deduct the problem. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|