HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
|
| 04 Jan 2013 06:27 PM |
Recently attempted to make a script that removed a characters old clothes, and replaced them with new ones, however when I try to remove them, in test mode, nothing happens, no errors, and no output from the print commands I put in the script, help please? game.Players.PlayerAdded:connect(onPlayerRespawned) function onPlayerRespawned(newPlayer) wait(1) print("Hi") shirt = character:FindFirstChild("Shirt") if (shirt ~= nil) then shirt:remove() end Print("1") pants = character:FindFirstChild("Pants") if (pants ~= nil) then pants:remove() end Print("2") tshirt = character:FindFirstChild("Shirt Graphic") if (tshirt ~= nil) then tshirt:remove() end Print("3")
end
|
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 06:34 PM |
Game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) repeat wait() until character:findFirstChild("Pants") print("Ready") wait(1) shirt = character:findFirstChild("Shirt") if shirt ~= nil then shirt:Destroy() end priint("Shirt removed") pants = character:findFirstChild("Pants") if pants ~= nil then pants:Destroy() end print("Pants removed") roblox = character.Torso:findFirstChild("roblox") if roblox ~= nil then roblox:Destroy() end tshirt = character:findFirstChild("Shirt Graphic") if tshirt ~= nil then tshirt:Destroy() end print("T-Shirt destroyed") end) end)
Not sure if it works, just run it and tell me the output. |
|
|
| Report Abuse |
|
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
| |
|
|
| 04 Jan 2013 06:47 PM |
priint("Shirt removed") Typo print("Shirt removed") |
|
|
| Report Abuse |
|
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
|
| 05 Jan 2013 07:47 AM |
Tried adding a new part to make a new set of clothes, however, it prints the "asdf" and "fdsa" parts, but when I check in the explorer under the testing character, no new clothes appear, and gives no error.
Game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) repeat wait() until character:findFirstChild("Pants") print("Ready") wait(1) shirt = character:findFirstChild("Shirt") if shirt ~= nil then shirt:Destroy() end print("Shirt removed") pants = character:findFirstChild("Pants") if pants ~= nil then pants:Destroy() end print("Pants removed") roblox = character.Torso:findFirstChild("roblox") if roblox ~= nil then roblox:Destroy() end tshirt = character:findFirstChild("Shirt Graphic") if tshirt ~= nil then tshirt:Destroy() end print("T-Shirt destroyed") NewTShirt = Instance.new("ShirtGraphic") NewPants = Instance.new("Pants") NewShirt = Instance.new("Shirt") print("fdsa") NewTShirt.Parent = _G["Character"] NewPants.Parent = _G["Character"] NewShirt.Parent = _G["Character"] --NewPants.PantsTemplate = "http://www.roblox.com/asset/?id=78845949" print("asdf") end) end) Any help is appreciated. |
|
|
| Report Abuse |
|
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
|
| 05 Jan 2013 07:48 AM |
| Almost forgot to mention, did set up the _G variables in a different script. |
|
|
| Report Abuse |
|
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
| |
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
| |
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
| |
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
| |
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
|
| 06 Jan 2013 07:07 AM |
| Bump of wondering why no one has responded. |
|
|
| Report Abuse |
|
|
ninja5566
|
  |
| Joined: 14 Jan 2009 |
| Total Posts: 5233 |
|
| |
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
|
| 06 Jan 2013 07:22 AM |
Tried adding a new part to make a new set of clothes, however, it prints the "asdf" and "fdsa" parts, but when I check in the explorer under the testing character, no new clothes appear, and gives no error.
Game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) repeat wait() until character:findFirstChild("Pants") print("Ready") wait(1) shirt = character:findFirstChild("Shirt") if shirt ~= nil then shirt:Destroy() end print("Shirt removed") pants = character:findFirstChild("Pants") if pants ~= nil then pants:Destroy() end print("Pants removed") roblox = character.Torso:findFirstChild("roblox") if roblox ~= nil then roblox:Destroy() end tshirt = character:findFirstChild("Shirt Graphic") if tshirt ~= nil then tshirt:Destroy() end print("T-Shirt destroyed") NewTShirt = Instance.new("ShirtGraphic") NewPants = Instance.new("Pants") NewShirt = Instance.new("Shirt") print("fdsa") NewTShirt.Parent = _G["Character"] NewPants.Parent = _G["Character"] NewShirt.Parent = _G["Character"] --NewPants.PantsTemplate = "http://www.roblox.com/asset/?id=78845949" print("asdf") end) end) Any Idea how to fix it? |
|
|
| Report Abuse |
|
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
| |
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
| |
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
|
| 06 Jan 2013 07:53 PM |
| My patiance has ended, time for faster bumps. |
|
|
| Report Abuse |
|
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
| |
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
| |
|
HD188753
|
  |
| Joined: 13 Jun 2012 |
| Total Posts: 5021 |
|
| |
|