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: Team Clothing Script [Please help!]

Previous Thread :: Next Thread 
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
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 is not online. 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
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
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 is not online. 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
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
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 is not online. 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
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
15 Jun 2012 06:50 PM
Each team has its own clothes. OrangeP OrangeS YellowP YellowS Will it work with that?
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
15 Jun 2012 06:51 PM
Yes, it will work with that.
Report Abuse
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
15 Jun 2012 06:54 PM
Didn't work.
Report Abuse
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
15 Jun 2012 06:55 PM
Come to my place, please.
Report Abuse
Spectrumw is not online. 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 is not online. 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
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