|
| 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 |
|
|
| |
|
|
| 28 Jan 2015 01:54 PM |
| also, Remove has the initial uppercase |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2015 01:55 PM |
| however, you should use :Destroy() in your scripts right now, because :Remove() is deprecated |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2015 01:58 PM |
I don't get it.
Output: expected 'end' to close at line 6 |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2015 01:59 PM |
| why don't you try adding an end then |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Jan 2015 02:13 PM |
| else if could be changed to elseif and does not require an end. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|