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: help with a script

Previous Thread :: Next Thread 
liavt is not online. liavt
Joined: 12 Mar 2009
Total Posts: 1241
25 Apr 2012 05:29 PM
local script6 = game.Players.LocalPlayer.PlayerGui.TeamGui.backround.TextButton.script6
local player = game.Players.LocalPlayer
local teamgui = script6.Parent.Parent.Parent

player.CharacterAdded:connect(function(character)

if (player.TeamColor == game.Teams["Green Team"].37) then
teamgui:destroy()
end

if (player.TeamColor == game.Teams["Red Team"].1009) then
teamgui:destroy()
end

if (player.TeamColor == game.Teams["Yellow Team"].1010) then
teamgui:destroy()
end

if (player.TeamColor == game.Teams["Blue Team"].1004) then
teamgui:destroy()
end


end)


and the output is
16:29:34 - Players.liavt.PlayerGui.TeamGui.backround.TextButton.script6:7: ')' expected near '.37'
even though there is a parentheses there.

btw its supposed to make it that if your on blue,green,yellow,or red team a certain gui will be destroyed
Report Abuse
liavt is not online. liavt
Joined: 12 Mar 2009
Total Posts: 1241
25 Apr 2012 06:35 PM
bump
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
25 Apr 2012 06:37 PM
local player = game.Players.LocalPlayer
local teamgui = player.PlayerGui.TeamGui
player.CharacterAdded:connect(function()
if player.TeamColor == BrickColor.Green() or player.TeamColor == BrickColor.Red() or player.TeamColor == BrickColor.Blue() or player.TeamColor == BrickColor.new("Bright yellow") then
teamgui:destroy()
end
end)
Report Abuse
liavt is not online. liavt
Joined: 12 Mar 2009
Total Posts: 1241
26 Apr 2012 07:03 AM
@above
not working, im on the green team and the teamgui appeared. but the output is not saying a mistake. ????
Report Abuse
liavt is not online. liavt
Joined: 12 Mar 2009
Total Posts: 1241
26 Apr 2012 07:04 AM
and also i noticed for the yellow team your changing the team TO be yellow. shouldnt it be brickcolor.yellow not brickcolor.new(yellow)
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
26 Apr 2012 07:30 AM
No, you don't know what you're saying.
Report Abuse
liavt is not online. liavt
Joined: 12 Mar 2009
Total Posts: 1241
26 Apr 2012 03:39 PM
whatever, its not working. i just said what i THOUGHT the problem was, but if it is wrong, than what is the real problem?
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
26 Apr 2012 03:43 PM
local script6 = game.Players.LocalPlayer.PlayerGui.TeamGui.backround.TextButton.script6
local player = game.Players.LocalPlayer
local teamgui = script6.Parent.Parent.Parent

player.CharacterAdded:connect(function(character)

if (player.TeamColor == game.Teams["Green Team"].TeamColor) then
teamgui:destroy()
end

if (player.TeamColor == game.Teams["Red Team"].TeamColor) then
teamgui:destroy()
end

if (player.TeamColor == game.Teams["Yellow Team"].TeamColor) then
teamgui:destroy()
end

if (player.TeamColor == game.Teams["Blue Team"].TeamColor) then
teamgui:destroy()
end


end)





Sorry I'm not really doing much, tired and don't feel like thinking. QQ
Report Abuse
liavt is not online. liavt
Joined: 12 Mar 2009
Total Posts: 1241
26 Apr 2012 03:46 PM
@above
isnt that the exact same script i started with?
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
26 Apr 2012 03:48 PM
Yes, but I don't get what the .37 and .1003 is...

You could just say TeamColor, since the number is obviously causing the error.


This is what the output meant:

')' expected near .37
Means that it wants you to close the parenthesis so it can multiple what's in the parenthesis by 0.37

Just right teamcolor and I so no issue
Report Abuse
liavt is not online. liavt
Joined: 12 Mar 2009
Total Posts: 1241
26 Apr 2012 03:50 PM
the numbers are the brickcolor code, and i just noticed the 0. is there and is not supposed to :/
Report Abuse
liavt is not online. liavt
Joined: 12 Mar 2009
Total Posts: 1241
26 Apr 2012 03:51 PM
@ilikeyou
your script works! thank you.
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
26 Apr 2012 03:52 PM
Does it really matter? TeamColor works the exact same and won't cause the problem.. Just try it T_T


write*
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
26 Apr 2012 09:17 PM
I made it much shorter.

local c = {"Green","Red","Yellow","Blue"}
local player = game.Players.LocalPlayer
player.CharacterAdded:connect(function()
for _,v in ipairs(c) do
if player.TeamColor == game.Teams[v.." Team"].TeamColor then
player.PlayerGui.TeamGui:Destroy()
end
end
end)
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