|
| 15 Jun 2012 06:17 PM |
I've been at this for a while, I need help urgently:
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
|
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 15 Jun 2012 06:22 PM |
Again: function Cloth(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 it. Please X______________________x I can ensure you it works. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2012 06:37 PM |
| I'm confused on what I need to change. I mean, what part is of cloning the uniform (OrangeP, YellowP, OrangeS, YellowS) to the person, what part identifies the teams "Orange" and "Yellow". Plus, I'm trying to get it to remove clothes from the "Orange" and "Yellow" team only. D: Please help! (Bright Yellow and Bright Orange are team colors) |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 15 Jun 2012 06:40 PM |
| You don't need to change anything D: it gets the team using string manipulation and returns the appropiate clothes stored in Lighting. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2012 06:42 PM |
| Ok! If you can make it to remove clothes from orange and yellow team only, I owe you big time. I've worked on this forever. |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 15 Jun 2012 06:44 PM |
Team = {['Bright yellow'] = true, ['Bright orange'] = true}
function Cloth(part) part['Pants']:Destroy() part['Shirt']:Destroy() end
game.Players.PlayerAdded:connect(function(plyr) if not Team[plyr.TeamColor.Name] then return end 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. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2012 06:50 PM |
| Each team has its own clothes. OrangeP OrangeS YellowP YellowS Will it work with that? |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 15 Jun 2012 06:51 PM |
| Yes, it will work with that. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 15 Jun 2012 06:57 PM |
| I already tested it with OrangeP, OrangeS, YellowS, and YellowP in Lighting. I tested it with both teams (Bright yellow and Bright orange) and it worked. So you probably did something wrong. |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 15 Jun 2012 07:02 PM |
Team = {['Bright yellow'] = true, ['Bright orange'] = true}
function Cloth(part) part['Pants']:Destroy() part['Shirt']:Destroy() end
game.Players.PlayerAdded:connect(function(plyr) plyr.CharacterAdded:connect(function(char) if not Team[plyr.TeamColor.Name] then return end 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) |
|
|
| Report Abuse |
|
|