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: A Square on the GUI changes colours according to team

Previous Thread :: Next Thread 
Logitech is not online. Logitech
Joined: 10 May 2007
Total Posts: 1813
01 Aug 2013 01:55 PM
Changes to a different colour depending on team when A team member touches a brick. Can some one give me some tips on how to do that?
Report Abuse
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
01 Aug 2013 01:59 PM
Make a script in Workspace and put the gui in the script with a localscript in the gui
Make the regular script have this code:
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:wait(); script.GUI_NAME:clone().Parent = plr.PlayerGui
end)

Then in the localscript have a while wait() do end loop
Just have it check the player's team and make the color the team color

~Professional ROBLOX Human
Report Abuse
Logitech is not online. Logitech
Joined: 10 May 2007
Total Posts: 1813
01 Aug 2013 02:12 PM
Thanks
Report Abuse
Logitech is not online. Logitech
Joined: 10 May 2007
Total Posts: 1813
01 Aug 2013 02:14 PM
Wait The GUI Colours are Hexadecimal How does that work if the Players team colours are set to Numerical Values?
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
01 Aug 2013 02:16 PM
The colors of GUIs are Color3 values, to change the teamcolor to color3 use plyr.TeamColor.Color
Report Abuse
Logitech is not online. Logitech
Joined: 10 May 2007
Total Posts: 1813
01 Aug 2013 09:31 PM
I have this now

StatusC = Workspace.StarterGui.Teams.Frame.C

function onTouch(hit)
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
if user ~= nil then

StatusC.BackgroundColor3 = user.TeamColor.Color

end
end

script.Parent.Touched:connect(onTouch)

Its not working though
Report Abuse
WishNite is not online. WishNite
Joined: 11 Feb 2009
Total Posts: 15828
01 Aug 2013 09:36 PM
You have to change the PlayerGui, not the StarterGui
Report Abuse
Logitech is not online. Logitech
Joined: 10 May 2007
Total Posts: 1813
01 Aug 2013 09:47 PM
StatusC = Workspace.PlayerGui.Teams.Frame.C

function onTouch(hit)
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
if user ~= nil then

StatusC.BackgroundColor3 = player.TeamColor.Color

end
end

script.Parent.Touched:connect(onTouch)

not working I think my parents are wrong
Report Abuse
Logitech is not online. Logitech
Joined: 10 May 2007
Total Posts: 1813
02 Aug 2013 08:18 AM
bamp
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
02 Aug 2013 08:33 AM
Since when was a player's PlayerGui in Workspace? Unless you've simply named a model, or similar 'PlayerGui'.
Report Abuse
Logitech is not online. Logitech
Joined: 10 May 2007
Total Posts: 1813
02 Aug 2013 08:36 PM
function onTouch(hit)
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
if user ~= nil then


Players.Player.PlayerGui.Teams.Frame.C = player.TeamColor.Color

end
end

script.Parent.Touched:connect(onTouch)

Now Need some help to change the Properties of C. C being the Text Box that I want to change. The Property that I want to change is BackgroundColor . What lines should I add?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 Aug 2013 08:37 PM
replace
Players.Player
with
user
Report Abuse
Logitech is not online. Logitech
Joined: 10 May 2007
Total Posts: 1813
02 Aug 2013 08:42 PM
Thanks CNT Still need to change the properties
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