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: Team Only GUI

Previous Thread :: Next Thread 
StratusNinja is not online. StratusNinja
Joined: 04 Nov 2012
Total Posts: 6144
16 Nov 2014 03:15 PM
I'll start of by saying I'm no excellent scripter, heh....

But how to do I make a GUI, specifically a loadout GUI in this scenario, appear every time someone dies? But only for ONE team, in this case team "Hostiles".

Emperor || Empire of Stratus || Walk Alone; Strive Together
Report Abuse
jhend27513 is not online. jhend27513
Joined: 17 Sep 2011
Total Posts: 3369
16 Nov 2014 03:17 PM
You can have serpate GUIs.

Having one with some code that states that if their belonging to one team, this GUI is visible.
Else
This other GUI is visible.
Report Abuse
StratusNinja is not online. StratusNinja
Joined: 04 Nov 2012
Total Posts: 6144
16 Nov 2014 03:27 PM
I seem to be struggling, this is what I've got so far:

player = game.Players.PlayerAdded


function onAdded()
if player.TeamColor == game.Teams.Hostiles.TeamColor then
game.Lighting.Gui:Clone().Parent = player.PlayerGui
end
end

game.Players.PlayerAdded:connect(onAdded)


This output says:
18:26:08.850 - TeamColor is not a valid member
18:26:08.851 - Script 'Workspace.Team stater packs', Line 5
18:26:08.852 - Stack End


The Hostiles is named correctly in the teams, and the "Gui" is in the lighting.
Emperor || Empire of Stratus || Walk Alone; Strive Together
Report Abuse
Xsitsu is not online. Xsitsu
Joined: 28 Jul 2009
Total Posts: 2921
16 Nov 2014 03:34 PM
It's not working because the function onAdded() does not receive any parameters.

Try this:

function onAdded(player)
if player.TeamColor == game.Teams.Hostiles.TeamColor then
game.Lighting.Gui:Clone().Parent = player.PlayerGui
end
end

game.Players.PlayerAdded:connect(onAdded)


and get rid of that bit above it that says:

player = game.Players.PlayerAdded
Report Abuse
StratusNinja is not online. StratusNinja
Joined: 04 Nov 2012
Total Posts: 6144
16 Nov 2014 03:49 PM
Sorry for the late reply, had a shower.

But thanks for the help! It's now working fully functional.

Emperor || Empire of Stratus || Walk Alone; Strive Together
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