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: Assigned Clothing.

Previous Thread :: Next Thread 
Kasumo is not online. Kasumo
Joined: 22 Mar 2013
Total Posts: 2467
13 Jul 2013 03:28 PM
--Why doesn't this give assigned clothing to everyone except the ranks inside the table? Can't figure out the problem.

AllowedRanks = {"Head Captain, Squad 1 Captain, Squad 2 Captain"}
function CheckRank(Player)
if Player:IsInGroup(864602) == false then
return false
end
for _, v in pairs(AllowedRanks) do
if string.find(Player:GetRoleInGroup(864602), v) ~= nil then
return true
end
end
return false
end

function removeClothes(Model)
for i, v in pairs(Model:GetChildren()) do
if v:IsA("Shirt") or v:IsA("ShirtGraphic") or v:IsA("Pants") then
v:Destroy()
end
end
end



game.Players.PlayerAdded:connect(function(newPlayer)
newPlayer.CharacterAdded:connect(function(Character)
if newPlayer:IsInGroup(864602) then
if not CheckRank(newPlayer) then
removeClothes(Character)
local shirt = Instance.new("Shirt", Character)
local pants = Instance.new("Pants", Character)
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=111034417"
pants.PantsTemplate = "http://www.roblox.com/asset/?id=103352376"
end
end
end)
end)
game.Players.PlayerAdded:connect(onPlayerEntered)
Report Abuse
789cab is not online. 789cab
Joined: 13 Jul 2009
Total Posts: 3145
13 Jul 2013 03:30 PM
Put the number of the rank instead of the name like you know in the group admin next to the name it says something about 255 for your rank.
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