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