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
 

Would this work?

Previous Thread :: Next Thread 
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
11 Apr 2012 07:37 PM
So I'm making a teams script, and I'm overpowering teams over teams.

function PlayerAddded(newPlayer)
if newPlayer:IsInGroup(210099) then
newPlayer.TeamColor="Bright blue" not new.Player.TeamColor="Black"
if newPlayer:IsInGroup(560554) then
new.Player.TeamColor="Black"
end
end)

newPlayer.TeamColor(newPlayer) -- Not sure about this line...

It seems to simple to work...
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
11 Apr 2012 07:41 PM
You know it's not going to work so why ask if it's going to work?

    game.Players.PlayerAdded:connect(function(plr)
        if plr:IsInGroup(210099) then
            plr.TeamColor=BrickColor.new("Bright blue")
        elseif plr:IsInGroup(560554) then
            plr.TeamColor=BrickColor.new("Black")
        else
            --Player not in a requested group
            plr.TeamColor=BrickColor.new("White")
        end)
    end)
Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
11 Apr 2012 07:41 PM
newPlayer.TeamColor="Bright blue" not new.Player.TeamColor="Black"

I'm guessing you just want to set it to Bright blue? You need that inside BrickColor.new(), and you don't need the not with it.

if newPlayer:IsInGroup(560554) then

That only runs if the player is inside the first group. Is this what you wanted? If yes, then you need another end with it; otherwise, you'll want to use "elseif."

newPlayer.TeamColor(newPlayer) -- Not sure about this line...

That needs to run when a player is added, so you can use the game.Players.PlayerAdded event.

function PlayerAddded(newPlayer)
if newPlayer:IsInGroup(210099) then
newPlayer.TeamColor=BrickColor.new("Bright blue")
elseif newPlayer:IsInGroup(560554) then
new.Player.TeamColor=BrickColor.new("Black")
end
end -- The function isn't running inside the connect, so this bracket isn't needed.

game.Players.PlayerAdded:connect(PlayerAdded)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
11 Apr 2012 07:42 PM
Game.Players.PlayerAdded:connect(function(newPlayer)
if newPlayer:IsInGroup(210099) then
newPlayer.TeamColor = BrickColor.new("Bright blue")
elseif newPlayer:IsInGroup(560554) then
new.Player.TeamColor = BrickColor.new("Black")
end
end)

† KMXD †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
11 Apr 2012 07:43 PM
Of course I'm late...It was too easy.. Dx

† KMXD †
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
11 Apr 2012 08:03 PM
For some reason, neither work.

The teams:
-Tactical Corporation
-Academy
-Neutral
-Raiders

Raiders = autoassignable
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
11 Apr 2012 08:13 PM
ffaacceeppaallmm

I just realised, NOW,

that all I needed to do for the academy team is:

if not new.Player:IsInGroup(210099) then


fail
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