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: Mind helping me on a team assign uniform script?

Previous Thread :: Next Thread 
Mephitical is not online. Mephitical
Joined: 23 Jan 2013
Total Posts: 1029
18 Feb 2013 10:51 AM
Yep. So, I made a script, however it does not appear to be working, and my output is not telling me what the issue is. Could I have some help, please?


function Heads( Person )
repeat
wait( )
until Person.Character
local Head = Person.Character.Head
local Copy = Head:clone( )
Copy.Name = Person.Name.."'s Head"
Copy.face:remove( )
Head.Transparency = 1
local Weld = Instance.new( "Weld" )
Weld.Part0 = Head
Weld.Part1 = Copy
Weld.Parent = Head.Parent
Copy.Parent = Head.Parent
repeat
wait( )
until Head.Parent:findFirstChild( "Body Colors" )
Copy.BrickColor = Head.Parent:findFirstChild( "Body Colors" ).HeadColor
end


function onRespawn(PLAYER,CHAR)
wait(2)
if DeHead == true then Heads(PLAYER) end

if CHAR ~= nil then
if CHAR:findFirstChild("Pants") ~= nil then
CHAR.Pants:remove()
end
if CHAR:findFirstChild("Shirt") ~= nil then
CHAR.Shirt:remove()
end
if PLAYER.TeamColor == BrickColor.new("Bright red") then--more team color >.>
P = script.RedPants:clone()
P.Name = "Pants"
P.Parent = CHAR
S = script.RedShirt:clone()
S.Name = "Shirt"
S.Parent = CHAR
else
P = script.BluePants:clone()
P.Name = "Pants"
P.Parent = CHAR
S = script.BlueShirt:clone()
S.Name = "Shirt"
S.Parent = CHAR
end
end
end
Report Abuse
Mephitical is not online. Mephitical
Joined: 23 Jan 2013
Total Posts: 1029
18 Feb 2013 11:07 AM
Bump. No help?
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
18 Feb 2013 11:09 AM
Put some print("stuff") throughout the script to help you identify the problem.
Report Abuse
Mephitical is not online. Mephitical
Joined: 23 Jan 2013
Total Posts: 1029
18 Feb 2013 12:32 PM
Thanks.
Report Abuse
Mephitical is not online. Mephitical
Joined: 23 Jan 2013
Total Posts: 1029
18 Feb 2013 12:36 PM
print("nonfail")
function Heads( Person )
repeat
wait( )
until Person.Character
local Head = Person.Character.Head
local Copy = Head:clone( )
Copy.Name = Person.Name.."'s Head"
Copy.face:remove( )
Head.Transparency = 1
local Weld = Instance.new( "Weld" )
Weld.Part0 = Head
Weld.Part1 = Copy
Weld.Parent = Head.Parent
Copy.Parent = Head.Parent
repeat
wait( )
until Head.Parent:findFirstChild( "Body Colors" )
Copy.BrickColor = Head.Parent:findFirstChild( "Body Colors" ).HeadColor
end

print("stuff1")

function onRespawn(PLAYER,CHAR)
wait(2)
if DeHead == true then Heads(PLAYER) end

if CHAR ~= nil then
if CHAR:findFirstChild("Pants") ~= nil then
CHAR.Pants:remove()
end
print("stuff2")
if CHAR:findFirstChild("Shirt") ~= nil then
CHAR.Shirt:remove()
end
print("stuff3")
if PLAYER.TeamColor == BrickColor.new("Bright red") then--more team color >.>
P = script.RedPants:clone()
P.Name = "Pants"
P.Parent = CHAR
S = script.RedShirt:clone()
S.Name = "Shirt"
S.Parent = CHAR
else
P = script.BluePants:clone()
P.Name = "Pants"
P.Parent = CHAR
S = script.BlueShirt:clone()
S.Name = "Shirt"
S.Parent = CHAR
end
end
end
print("end")

It goes from nonfail, to stuff1, straight to end, and it does not point out what is wrong with the other prints in the script.
Report Abuse
Mephitical is not online. Mephitical
Joined: 23 Jan 2013
Total Posts: 1029
18 Feb 2013 02:47 PM
Uhh Bump?
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
18 Feb 2013 03:38 PM
You onRespawn function never goes.
Report Abuse
Mephitical is not online. Mephitical
Joined: 23 Jan 2013
Total Posts: 1029
18 Feb 2013 04:04 PM
How does one fix that?
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
18 Feb 2013 04:11 PM
By using playeradded and characteradded events :3

function playeradded(p)
p.CharacterAdded:connect(function() onRespawn(p) end)
end
game:GetService("Players").PlayerAdded:connect(playeradded)

something along those lines, it prolly wont work what i have above though :O, just an example
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