|
| 14 Jun 2012 06:57 PM |
Not sure what's wrong:
local team1 = game.Teams:findFirstChild("Orange") local team2 = game.Teams:findFirstChild("Yellow")
local t1shirt = game.Lighting:findFirstChild("OrangeS") local t2shirt = game.Lighting:findFirstChild("YellowS")
local t1pants = game.Lighting:findFirstChild("OrangeP") local t2pants = game.Lighting:findFirstChild("YellowP")
function onPlayerRespawn(property, player)
wait(1)
if player.TeamColor == BrickColor.new("Bright orange") or player.TeamColor == BrickColor.new("Bright yellow") then for i,v in pairs(player.Character:GetChildren()) do if clothing[v].className == "Pants" or clothing[v].className == "Shirt" then clothing[v]:remove() end end
if player.TeamColor == team1.TeamColor then
t1shirt:Clone().Parent = player.Character t1pants:Clone().Parent = player.Character
elseif player.TeamColor == team2.TeamColor then
t2shirt:Clone().Parent = player.Character t2pants:Clone().Parent = player.Character
end end end
|
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Jun 2012 07:18 PM |
Bump.
Helppppppppp, I need somebody! I have no clue what's wrong. |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2012 08:02 PM |
Bump. Seriously, I need help. D: |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2012 08:05 PM |
Not sure if this would help, but I made this recently:
pnts = script.Pants shirt = script.Shirt
function GiveClothes(character) if not character:findFirstChild("Shirt") then shirt:Clone().Parent = character else character:findFirstChild("Shirt"):Destroy() shirt:Clone().Parent = character end
if not character:findFirstChild("Pants") then pnts:Clone().Parent = character else character:findFirstChild("Pants"):Destroy() pnts:Clone().Parent = character end end
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(char) wait(1.12) local plr = game.Players:findFirstChild(char.Name) print(char.Name)
if plr.TeamColor ~= BrickColor.new("Camo") then return else GiveClothes(char) end end) end)
- Striked |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2012 08:09 PM |
| You are checking the teamcolor twice, because you didn't end the first 'if' statement. |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2012 08:15 PM |
local team1 = game.Teams:findFirstChild("Orange") local team2 = game.Teams:findFirstChild("Yellow")
local t1shirt = game.Lighting:findFirstChild("OrangeS") local t2shirt = game.Lighting:findFirstChild("YellowS")
local t1pants = game.Lighting:findFirstChild("OrangeP") local t2pants = game.Lighting:findFirstChild("YellowP")
function onPlayerRespawn(property, player)
wait(1)
if player.TeamColor == BrickColor.new("Bright orange") or player.TeamColor == BrickColor.new("Bright yellow") then for i,v in pairs(player.Character:GetChildren()) do if clothing[v].className == "Pants" or clothing[v].className == "Shirt" then clothing[v]:remove() end end end if player.TeamColor == team1.TeamColor then
t1shirt:Clone().Parent = player.Character t1pants:Clone().Parent = player.Character
elseif player.TeamColor == team2.TeamColor then
t2shirt:Clone().Parent = player.Character t2pants:Clone().Parent = player.Character
end end end
Still isn't working.. |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2012 08:18 PM |
Too many ends at the end remove one
- Striked |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 14 Jun 2012 08:22 PM |
function Cloth(part) print(part) part['Pants']:Destroy() part['Shirt']:Destroy() end
game.Players.PlayerAdded:connect(function(plyr) plyr.CharacterAdded:connect(function(char) wait(1) local t = plyr.TeamColor.Name:sub(8) pcall(Cloth, char) game.Lighting[t:sub(0, 1):upper() .. t:sub(2) .. 'S']:Clone().Parent = char game.Lighting[t:sub(0, 1):upper() .. t:sub(2) .. 'P']:Clone().Parent = char end) end)
Try this :3 |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2012 08:25 PM |
local team1 = game.Teams:findFirstChild("Orange") local team2 = game.Teams:findFirstChild("Yellow")
local t1shirt = game.Lighting:findFirstChild("OrangeS") local t2shirt = game.Lighting:findFirstChild("YellowS")
local t1pants = game.Lighting:findFirstChild("OrangeP") local t2pants = game.Lighting:findFirstChild("YellowP")
function onPlayerRespawn(property, player)
wait(1)
if player.TeamColor == BrickColor.new("Bright orange") or player.TeamColor == BrickColor.new("Bright yellow") then for i,v in pairs(player.Character:GetChildren()) do if clothing[v].className == "Pants" or clothing[v].className == "Shirt" then clothing[v]:remove() end end end if player.TeamColor == team1.TeamColor then
t1shirt:Clone().Parent = player.Character t1pants:Clone().Parent = player.Character
elseif player.TeamColor == team2.TeamColor then
t2shirt:Clone().Parent = player.Character t2pants:Clone().Parent = player.Character
end end
Still, the cloning of uniform failed. |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2012 08:27 PM |
there's no connection line too
- Striked |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2012 08:27 PM |
| Example? I'm not a great scripter. |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 14 Jun 2012 08:30 PM |
@bloddy Have you tried mine? ;_; |
|
|
| Report Abuse |
|
|
| |
|
rayoma
|
  |
| Joined: 13 Nov 2009 |
| Total Posts: 1911 |
|
|
| 14 Jun 2012 08:56 PM |
I love how you just ignore spectrumW even though he's the most able-scripter that has posted...
|
|
|
| Report Abuse |
|
|
|
| 14 Jun 2012 08:56 PM |
| Bump. SOMEONE PLEASE FIX THIS!? |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2012 08:57 PM |
| Not ignoring, don't think the script fits what I need. |
|
|
| Report Abuse |
|
|
rayoma
|
  |
| Joined: 13 Nov 2009 |
| Total Posts: 1911 |
|
| |
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 14 Jun 2012 08:58 PM |
| As I said, have you even tried it... ? |
|
|
| Report Abuse |
|
|