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: Problem

Previous Thread :: Next Thread 
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
16 Mar 2014 04:10 PM
My script removes the chat bar for a certain rank in a certain group, this part works. It is then supposed to put on clothes for that same rank, but that doesn't work. There normal character clothes stay on.

if game.Players.LocalPlayer:GetRankInGroup(533656) == 11 then
game.StarterGui:SetCoreGuiEnabled(3,false)
shirtId = 138531229
pantsId = 138531277
repeat wait() until game.Players.LocalPlayer.Character

shirt = Instance.new("Shirt")
shirt.ShirtTemplate="http://www.roblox.com/asset/?id="..shirtId
pants = Instance.new("Pants")
pants.PantsTemplate = "http://www.roblox.com/asset/?id="..pantsId
shirt.Parent = game.Players.LocalPlayer.Character
pants.Parent = game.Players.LocalPlayer.Character
end
Report Abuse
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
16 Mar 2014 04:46 PM
Anyone?
Report Abuse
UnchainedPsycho is not online. UnchainedPsycho
Joined: 08 Apr 2011
Total Posts: 41
16 Mar 2014 05:17 PM
Try removing the shirt and pants that are currently on the player or changing the ID of the current clothing instead of adding a new instance.
Report Abuse
Jonibus is not online. Jonibus
Joined: 30 Jan 2010
Total Posts: 8985
16 Mar 2014 05:20 PM
You need to remove the original shirt and pants

Follow me on twitter: @Jonibus_RBX
Report Abuse
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
17 Mar 2014 09:24 PM
How do I do that?
Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
17 Mar 2014 09:32 PM
try

game.Players.LocalPlayer.Character:FindFirstChild("Pants"):Destroy()
game.Players.LocalPlayer.Character:FindFirstChild("Shirt"):Destroy()
-- Add checks to make sure they arent nil first!
Report Abuse
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
17 Mar 2014 10:06 PM
Thank you.
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
17 Mar 2014 10:08 PM
WHOAH.
What if the person isn't wearing a shirt? You better use pcall or an if function to be safe, unless you want to break your script!

pcall(function()
game.Players.LocalPlayer.Character:FindFirstChild("Pants"):Destroy()
game.Players.LocalPlayer.Character:FindFirstChild("Shirt"):Destroy()
end)
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
17 Mar 2014 10:09 PM
Fail
"What if the person isn't wearing a shirt? You better use pcall or an if function to be safe, unless you want to break your script!"
Meant
What if the person isn't wearing a shirt? You better use pcall function or an if statement to be safe - unless you want to break your script!
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