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 » Scripters
Home Search
 

Re: {URGENT} TeamColor Help?

Previous Thread :: Next Thread 
Quadratrix is not online. Quadratrix
Joined: 06 Jan 2015
Total Posts: 353
28 Jan 2015 01:53 PM
Is this the correct way to do it? Line 9 where is says 'else if player.TeamColor...'
else has a error, says it needs an 'end'

local gps = game.GamePassService
local player = game.Players.LocalPlayer
local id = 201884324


if gps:PlayerHasPass(player, id) and player.TeamColor == BrickColor.new("Bright red") then do
v = game.Lighting["GoldSword"]:clone()
v.Parent = player.Backpack
else if player.TeamColor == BrickColor.new("Sand green") then
s = player.Backpack:findFirstChild("GoldSword")
s:remove()
end
end
end
Report Abuse
warycapdecutie is not online. warycapdecutie
Joined: 13 Aug 2010
Total Posts: 14373
28 Jan 2015 01:53 PM
elseif is in one work
Report Abuse
warycapdecutie is not online. warycapdecutie
Joined: 13 Aug 2010
Total Posts: 14373
28 Jan 2015 01:54 PM
also, Remove has the initial uppercase
Report Abuse
warycapdecutie is not online. warycapdecutie
Joined: 13 Aug 2010
Total Posts: 14373
28 Jan 2015 01:55 PM
however, you should use :Destroy() in your scripts right now, because :Remove() is deprecated
Report Abuse
Quadratrix is not online. Quadratrix
Joined: 06 Jan 2015
Total Posts: 353
28 Jan 2015 01:58 PM
I don't get it.

Output: expected 'end' to close at line 6
Report Abuse
warycapdecutie is not online. warycapdecutie
Joined: 13 Aug 2010
Total Posts: 14373
28 Jan 2015 01:59 PM
why don't you try adding an end then
Report Abuse
Quadratrix is not online. Quadratrix
Joined: 06 Jan 2015
Total Posts: 353
28 Jan 2015 02:00 PM
I did, it still errors.
Report Abuse
BrickConnector is not online. BrickConnector
Joined: 10 Sep 2011
Total Posts: 3437
28 Jan 2015 02:13 PM
else if could be changed to elseif and does not require an end.
Report Abuse
Quadratrix is not online. Quadratrix
Joined: 06 Jan 2015
Total Posts: 353
28 Jan 2015 02:17 PM
I changed it to elseif, and I removed and end or added and end

I tried both and it still errors? Any help on redoing the code for me?
Report Abuse
treebee63 is not online. treebee63
Joined: 16 Aug 2010
Total Posts: 376
28 Jan 2015 02:23 PM
At line six where it checks for Bright red team, is the "do" after the argument suppose to be there? Forgive me if I'm wrong I'm new to this stuff.
Report Abuse
treebee63 is not online. treebee63
Joined: 16 Aug 2010
Total Posts: 376
28 Jan 2015 02:28 PM

local gps = game.GamePassService
local player = game.Players.LocalPlayer
local id = 201884324


if gps:PlayerHasPass(player, id) and player.TeamColor == BrickColor.new("Bright red") then
v = game.Lighting["GoldSword"]:clone()
v.Parent = player.Backpack
elseif player.TeamColor == BrickColor.new("Sand green") then
s = player.Backpack:findFirstChild("GoldSword")
s:Remove()
end
Report Abuse
iGotRekt is not online. iGotRekt
Joined: 23 Jan 2014
Total Posts: 831
28 Jan 2015 02:30 PM
else if player.TeamColor == BrickColor.new("Sand green") then

I'm just a beginner, correct me if I'm wrong, but wouldn't it just be

elseif player.TeamColor == "Sand green" then
BrickColor.new is only used if you're changing the color?
Report Abuse
iGotRekt is not online. iGotRekt
Joined: 23 Jan 2014
Total Posts: 831
28 Jan 2015 02:34 PM
I think this is how it would go:

local gps = game.GamePassService
local player = game.Players.LocalPlayer
local id = 201884324

if gps:PlayerHasPass(player, id) and player.TeamColor == "Bright red" then
v = game.Lighting.GoldSword:Clone()
v.Parent = player.Backpack
elseif player.TeamColor == "Sand green" then
local s = player.Backpack:FindFirstChild("GoldSword")
s:Destroy()
end
end
end --I think there's only supposed to be two ends, but I'm not sure.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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