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: Need help on this clothes script

Previous Thread :: Next Thread 
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
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
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
14 Jun 2012 07:10 PM
Bump.
Please help!
Report Abuse
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
14 Jun 2012 07:18 PM
Bump.

Helppppppppp, I need somebody! I have no clue what's wrong.
Report Abuse
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
14 Jun 2012 08:02 PM
Bump.
Seriously, I need help.
D:
Report Abuse
LordStriked is not online. LordStriked
Joined: 19 Mar 2011
Total Posts: 5396
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
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
14 Jun 2012 08:09 PM
You are checking the teamcolor twice, because you didn't end the first 'if' statement.
Report Abuse
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
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
LordStriked is not online. LordStriked
Joined: 19 Mar 2011
Total Posts: 5396
14 Jun 2012 08:18 PM
Too many ends at the end
remove one

- Striked
Report Abuse
Spectrumw is not online. 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
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
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
LordStriked is not online. LordStriked
Joined: 19 Mar 2011
Total Posts: 5396
14 Jun 2012 08:27 PM
there's no connection line too

- Striked
Report Abuse
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
14 Jun 2012 08:27 PM
Example? I'm not a great scripter.
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
14 Jun 2012 08:30 PM
@bloddy
Have you tried mine? ;_;
Report Abuse
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
14 Jun 2012 08:48 PM
Bump.
Report Abuse
rayoma is not online. 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
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
14 Jun 2012 08:56 PM
Bump. SOMEONE PLEASE FIX THIS!?
Report Abuse
bloodyspartan18 is not online. bloodyspartan18
Joined: 22 Apr 2010
Total Posts: 30260
14 Jun 2012 08:57 PM
Not ignoring, don't think the script fits what I need.
Report Abuse
rayoma is not online. rayoma
Joined: 13 Nov 2009
Total Posts: 1911
14 Jun 2012 08:57 PM
But it does?
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
14 Jun 2012 08:58 PM
As I said, have you even tried it... ?
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