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: Uniform changer

Previous Thread :: Next Thread 
zeropoint77 is not online. zeropoint77
Joined: 04 Apr 2010
Total Posts: 48
16 Mar 2014 12:09 PM
This script for some reason will not change the uniform to my group members according to their rank. I put in all the correct information and as far as i know it should work but it does not change what people wear. One of my friends said something about a on character added function. Not sure what thats means, but could some one help?

wait(1)

group = 1047086 -- set this to your group id

rankuniforms = true -- set to false if you have one uniform for all members

shirtnoranks = "http://www.roblox.com/asset/?id=" -- shirt asset, only needed if rankuniforms is false

pantsnoranks = "http://www.roblox.com/asset/?id=" -- pants asset, only needed if rankuniforms is false


totalranks = 14 -- total number of ranks


rank1 = 255 -- rank number in group admin

shirt1 = "http://www.roblox.com/asset/?id=147570209" -- rank 1 shirt asset

pants1 = "http://www.roblox.com/asset/?id=147570209" -- rank 1 pants asset


rank2 = 254 -- rank number in group admin

shirt2 = "http://www.roblox.com/asset/?id=147570209" -- rank 2 shirt asset

pants2 = "http://www.roblox.com/asset/?id=147570209" -- rank 2 pants asset


rank3 = 253 -- rank number in group admin

shirt3 = "http://www.roblox.com/asset/?id=147570209" -- rank 3 shirt asset

pants3 = "http://www.roblox.com/asset/?id=147570209" -- rank 3 pants asset


rank4 = 253 -- rank number in group admin

shirt4 = "http://www.roblox.com/asset/?id=147570209" -- rank 4 shirt asset

pants4 = "http://www.roblox.com/asset/?id=147570209" -- rank 4 pants asset


rank5 = 252 -- rank number in group admin

shirt5 = "http://www.roblox.com/asset/?id=147570209" -- rank 5 shirt asset

pants5 = "http://www.roblox.com/asset/?id=147570209" -- rank 5 pants asset


rank6 = 251 -- rank number in group admin

shirt6 = "http://www.roblox.com/asset/?id=147570209" -- rank 6 shirt asset

pants6 = "http://www.roblox.com/asset/?id=147570209" -- rank 6 pants asset


rank7 = 250 -- rank number in group admin

shirt7 = "http://www.roblox.com/asset/?id=147351925" -- rank 7 shirt asset

pants7 = "http://www.roblox.com/asset/?id=147351925" -- rank 7 pants asset


rank8 = 249 -- rank number in group admin

shirt8 = "http://www.roblox.com/asset/?id=147351925" -- rank 8 shirt asset

pants8 = "http://www.roblox.com/asset/?id=147351925" -- rank 8 pants asset


rank9 = 248 -- rank number in group admin

shirt9 = "http://www.roblox.com/asset/?id=147351925" -- rank 9 shirt asset

pants9 = "http://www.roblox.com/asset/?id=147351925" -- rank 9 pants asset


rank10 = 247 -- rank number in group admin

shirt10 = "http://www.roblox.com/asset/?id=147351925" -- rank 10 shirt asset

pants10 = "http://www.roblox.com/asset/?id=147351925" -- rank 10 pants asset


rank11 = 246 -- rank number in group admin

shirt11 = "http://www.roblox.com/asset/?id=147751808" -- rank 11 shirt asset

pants11 = "http://www.roblox.com/asset/?id=147751808" -- rank 11 pants asset


rank12 = 244 -- rank number in group admin

shirt12 = "http://www.roblox.com/asset/?id=147751808" -- rank 12 shirt asset

pants12 = "http://www.roblox.com/asset/?id=147751808" -- rank 12 pants asset


rank13 = 243 -- rank number in group admin

shirt13 = "http://www.roblox.com/asset/?id=147751808" -- rank 13 shirt asset

pants13 = "http://www.roblox.com/asset/?id=147751808" -- rank 13 pants asset


rank14 = 242 -- rank number in group admin

shirt14 = "http://www.roblox.com/asset/?id=147751808" -- rank 14 shirt asset

pants14 = "http://www.roblox.com/asset/?id=147751808" -- rank 14 pants asset


rank15 = 01 -- rank number in group admin

shirt15 = "http://www.roblox.com/asset/?id=" -- rank 15 shirt asset

pants15 = "http://www.roblox.com/asset/?id=" -- rank 15 pants asset


plr = script.Parent.Parent

repeat wait(.25) until plr.Character ~= nil

wait(1)

char = plr.Character

if plr:IsInGroup(group) then

if char:FindFirstChild("Pants") ~= nil then

else

pnts = Instance.new("Pants")

pnts.Name = "Pants"

pnts.Parent = char

end

if char:FindFirstChild("Shirt") ~= nil then

else

pnts = Instance.new("Shirt")

pnts.Name = "Shirt"

pnts.Parent = char

end

if rankuniforms == true then

if plr:GetRankInGroup(group)== rank1 then

char.Shirt.ShirtTemplate = shirt1

char.Pants.PantsTemplate = Pants1

elseif plr:GetRankInGroup(group)== rank2 then

char.Shirt.ShirtTemplate = shirt2

char.Pants.PantsTemplate = Pants2

elseif plr:GetRankInGroup(group)== rank3 then

char.Shirt.ShirtTemplate = shirt3

char.Pants.PantsTemplate = Pants3

elseif plr:GetRankInGroup(group)== rank4 then

char.Shirt.ShirtTemplate = shirt4

char.Pants.PantsTemplate = Pants4

elseif plr:GetRankInGroup(group)== rank5 then

char.Shirt.ShirtTemplate = shirt5

char.Pants.PantsTemplate = Pants5

elseif plr:GetRankInGroup(group)== rank6 then

char.Shirt.ShirtTemplate = shirt6

char.Pants.PantsTemplate = Pants6

elseif plr:GetRankInGroup(group)== rank7 then

char.Shirt.ShirtTemplate = shirt7

char.Pants.PantsTemplate = Pants7

elseif plr:GetRankInGroup(group)== rank8 then

char.Shirt.ShirtTemplate = shirt8

char.Pants.PantsTemplate = Pants8

elseif plr:GetRankInGroup(group)== rank9 then

char.Shirt.ShirtTemplate = shirt9

char.Pants.PantsTemplate = Pants9

elseif plr:GetRankInGroup(group)== rank10 then

char.Shirt.ShirtTemplate = shirt10

char.Pants.PantsTemplate = Pants10

elseif plr:GetRankInGroup(group)== rank11 then

char.Shirt.ShirtTemplate = shirt11

char.Pants.PantsTemplate = Pants11

elseif plr:GetRankInGroup(group)== rank12 then

char.Shirt.ShirtTemplate = shirt12

char.Pants.PantsTemplate = Pants12

elseif plr:GetRankInGroup(group)== rank13 then

char.Shirt.ShirtTemplate = shirt13

char.Pants.PantsTemplate = Pants13

elseif plr:GetRankInGroup(group)== rank14 then

char.Shirt.ShirtTemplate = shirt14

char.Pants.PantsTemplate = Pants14

elseif plr:GetRankInGroup(group)== rank15 then

char.Shirt.ShirtTemplate = shirt15

char.Pants.PantsTemplate = Pants15

end

else

char.Shirt.ShirtTemplate = shirtnoranks

char.Pants.PantsTemplate = pantsnoranks

end

end


--S-1894>(Supreme_Commander_Of_Advanced_Zero)
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
16 Mar 2014 12:17 PM
my eyes

#nerdsunited
Report Abuse
blueboy112 is not online. blueboy112
Joined: 15 Apr 2009
Total Posts: 802
16 Mar 2014 12:23 PM
*Cringes*
The code is very ugly and... looks insufficient

Look, I do things now! http://www.roblox.com/Forum/ShowPost.aspx?PostID=128214378
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
16 Mar 2014 12:24 PM
*Crys*

I've never seen code like this and especially it's even a free model, which makes it worse.
Report Abuse
blueboy112 is not online. blueboy112
Joined: 15 Apr 2009
Total Posts: 802
16 Mar 2014 12:26 PM
Mmk, time to help.

Uh. Oh lawd.

How do I go about this without wasting too much time.

Hire me! http://www.roblox.com/Forum/ShowPost.aspx?PostID=128214378
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
16 Mar 2014 12:35 PM
Ewwwww. My eyes hurt :(
Put this in a script IN WORKSPACE
Edit the shirts and pants table. Here is a template:
[RANK] = "SHIRT/PANTS ASSET LINK", [RANK] = "SHIRT/PANTS ASSET LINK"

group = 1047086
shirts = {[255] = "http://www.roblox.com/asset/?id=147570209"}
pants = {[255] = "http://www.roblox.com/asset/?id=147570209"}

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function()
wait()
if player:IsInGroup(group) then --I think that's the right method...
rank = player:GetRoleInGroup(group)
for _,v in pairs(shirts) do
if _ == rank then
shirt = v
end
end

for _,v in pairs(pants) do
if _ == rank then
shirt = v
end
end

if player.Character:FindFirstChild("Shirt") then
player.Character["Shirt"]:destroy()
end
if player.Character:FindFirstChild("Shirt") then
player.Character["Shirt"]:destroy()
end

newShirt = Instance.new("Shirt")
newPants = Instance.new("Pants")

newShirt.Name = "Shirt"
newShirt.ShirtTemplate = shirt

newPants.Name = "Pants"
newPants.PantsTemplate = pants
end
end)
end)




WAY more efficient.
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
16 Mar 2014 12:36 PM
Oops. Made a little mistake. =P that should work now. I put an if function for "Shirt" twice.

group = 1047086
shirts = {[255] = "http://www.roblox.com/asset/?id=147570209"}
pants = {[255] = "http://www.roblox.com/asset/?id=147570209"}

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function()
wait()
if player:IsInGroup(group) then --I think that's the right method...
rank = player:GetRoleInGroup(group)
for _,v in pairs(shirts) do
if _ == rank then
shirt = v
end
end

for _,v in pairs(pants) do
if _ == rank then
shirt = v
end
end

if player.Character:FindFirstChild("Shirt") then
player.Character["Shirt"]:destroy()
end
if player.Character:FindFirstChild("Pants") then
player.Character["Pants"]:destroy()
end

newShirt = Instance.new("Shirt")
newPants = Instance.new("Pants")

newShirt.Name = "Shirt"
newShirt.ShirtTemplate = shirt

newPants.Name = "Pants"
newPants.PantsTemplate = pants
end
end)
end)
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
16 Mar 2014 12:44 PM
No praise for that beautiful script I just made?
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
16 Mar 2014 01:29 PM
No thanks either?
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