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: Why doesn't this work?

Previous Thread :: Next Thread 
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
19 Nov 2011 10:56 AM
--Id's
HR = 0
MA = 0
Raiders = 0


--Color's
HRColor = "Really black"
MAColor = "Camo"
RaiderColor = "Bright red"
VistorColor = "Bright yellow"


game.Players.PlayerAdded:connect(function (newPlayer)
wait(15)
if P:IsInGroup(HR) then
P.TeamColor = BrickColor.new(HRColor)
return end

else if P:IsInGroup(MA) then
P.TeamColor = BrickColor.new(MAColor)
return end

else if P:IsInGroup(Raiders) then
P.TeamColor = BrickColor.new(RaiderColor)
return end


else P.TeamColor = BrickColor.new(MAColor)
end
--Created By Rames7



Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
19 Nov 2011 10:58 AM
Mabe because you didn't define P.

HR = 0
MA = 0
Raiders = 0
--Color's
HRColor = "Really black"
MAColor = "Camo"
RaiderColor = "Bright red"
VistorColor = "Bright yellow"
game.Players.PlayerAdded:connect(function(P)
wait(15)
if P:IsInGroup(HR) then
P.TeamColor = BrickColor.new(HRColor)
return end
else if P:IsInGroup(MA) then
P.TeamColor = BrickColor.new(MAColor)
return end
else if P:IsInGroup(Raiders) then
P.TeamColor = BrickColor.new(RaiderColor)
return end
else P.TeamColor = BrickColor.new(MAColor)
end
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
19 Nov 2011 11:00 AM
hmmm doesn't work.
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
19 Nov 2011 11:01 AM
HR = 0
MA = 0
Raiders = 0
--Color's
HRColor = "Really black"
MAColor = "Camo"
RaiderColor = "Bright red"
VistorColor = "Bright yellow"
game.Players.PlayerAdded:connect(function(P)
wait(15)
if P:IsInGroup(HR) then
P.TeamColor = BrickColor.new(HRColor)
return end
elseif P:IsInGroup(MA) then
P.TeamColor = BrickColor.new(MAColor)
return end
elseif P:IsInGroup(Raiders) then
P.TeamColor = BrickColor.new(RaiderColor)
return end
else P.TeamColor = BrickColor.new(MAColor)
end
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
19 Nov 2011 11:02 AM
    HR = 0
    MA = 0
    Raiders = 0
    --Color's
    HRColor = "Really black"
    MAColor = "Camo"
    RaiderColor = "Bright red"
    VistorColor = "Bright yellow"
    game.Players.PlayerAdded:connect(function(P)
    wait(15)
    if P:IsInGroup(HR) then
    P.TeamColor = BrickColor.new(HRColor)
    elseif P:IsInGroup(MA) then
    P.TeamColor = BrickColor.new(MAColor)
    elseif P:IsInGroup(Raiders) then
    P.TeamColor = BrickColor.new(RaiderColor)
    else P.TeamColor = BrickColor.new(MAColor)
    end end)
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
19 Nov 2011 11:03 AM
I still don't get it, doesn't work.
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
19 Nov 2011 11:06 AM
    HR = 0
    MA = 0
    Raiders = 0
    --Color's
    HRColor = "Really black"
    MAColor = "Camo"
    RaiderColor = "Bright red"
    VistorColor = "Bright yellow"
    game.Players.PlayerAdded:connect(function(P)
    wait(15)
    if P:IsInGroup(HR) then
    P.TeamColor = BrickColor.new(HRColor)
    return end
    elseif P:IsInGroup(MA) then
    P.TeamColor = BrickColor.new(MAColor)
    return end
    elseif P:IsInGroup(Raiders) then
    P.TeamColor = BrickColor.new(RaiderColor)
    return end
    else P.TeamColor = BrickColor.new(MAColor)
    end)

> > > > > > > > > > > > > > > > > > > > > > > :P
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
19 Nov 2011 11:08 AM
Do you understand it, it doesn't work D:
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
19 Nov 2011 11:12 AM
Why are you using end after return under elseif statement?, ARE YOU INSANE?
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
19 Nov 2011 11:12 AM
Do you understand that you need to tell me the Output?
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
19 Nov 2011 11:12 AM
LOL good point.
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
19 Nov 2011 11:14 AM
Da Output

Workspace.Script:14: 'end' expected (to close 'function' at line 9) near 'elseif'
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
19 Nov 2011 11:14 AM
It is because you'r using end after return under elseif.... >.<
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
19 Nov 2011 11:15 AM
HR = 0
MA = 0
Raiders = 0
--Color's
HRColor = "Really black"
MAColor = "Camo"
RaiderColor = "Bright red"
VistorColor = "Bright yellow"
game.Players.PlayerAdded:connect(function(P)
wait(15)
if P:IsInGroup(HR) then
P.TeamColor = BrickColor.new(HRColor)
elseif P:IsInGroup(MA) then
P.TeamColor = BrickColor.new(MAColor)
elseif P:IsInGroup(Raiders) then
P.TeamColor = BrickColor.new(RaiderColor)
else P.TeamColor = BrickColor.new(MAColor)
end end)
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
19 Nov 2011 11:18 AM
Current


HR = 0
MA = 0
Raiders = 0
--Color's
HRColor = "Really black"
MAColor = "Camo"
RaiderColor = "Bright red"
VistorColor = "Bright yellow"
game.Players.PlayerAdded:connect(function(P)
wait(15)
if P:IsInGroup(HR) then
P.TeamColor = BrickColor.new(HRColor)
return P
elseif P:IsInGroup(MA) then
P.TeamColor = BrickColor.new(MAColor)
return P
elseif P:IsInGroup(Raiders) then
P.TeamColor = BrickColor.new(RaiderColor)
return P
else P.TeamColor = BrickColor.new(MAColor)
end
end


Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
19 Nov 2011 11:20 AM
Ignore that last one I posted, with the new one(two above), the output is nothing
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
19 Nov 2011 11:21 AM
I bet you dont know what return even does >.^ <-- disappointed face mixed with happy one :P
Report Abuse
Ultraw is not online. Ultraw
Joined: 20 Nov 2010
Total Posts: 6575
19 Nov 2011 11:55 AM
If you are trying to run it, try to put in the ID of the group
Report Abuse
Ultraw is not online. Ultraw
Joined: 20 Nov 2010
Total Posts: 6575
19 Nov 2011 11:56 AM
isnt it just 0?
You need to change that to run it
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
19 Nov 2011 04:51 PM
Bump...
Report Abuse
Bob123456789103570 is not online. Bob123456789103570
Joined: 23 Dec 2008
Total Posts: 9531
19 Nov 2011 04:55 PM
Are you trying to play it in solo?

The IsInGroup call now only works in online mode due to a Roblox update
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
19 Nov 2011 04:56 PM
I'm not worried about the ID ifs, The last else doesn't work D:
Report Abuse
Bob123456789103570 is not online. Bob123456789103570
Joined: 23 Dec 2008
Total Posts: 9531
19 Nov 2011 04:56 PM
That last else needs to be elseif as well
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
19 Nov 2011 04:57 PM
why?
Report Abuse
Bob123456789103570 is not online. Bob123456789103570
Joined: 23 Dec 2008
Total Posts: 9531
19 Nov 2011 04:59 PM
because it is a conditional statement

"else" can't go with a condition
"if" starts the function
"elseif" is for everything else

"'else' ... code" won't work.
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