|
| 20 Jul 2017 02:53 AM |
I'm trying to make a script that changes a players pants on spawn. Why isn't this working? local pantsID = "rbxassetid://17794699"
game.Players.PlayersAdded:connect(function(player) player.CharacterAdded:connect(function(character) local pants = character:WaitForChild('Pants') pants.PantsTemplate = "rbxassetid://17794699" end) end)
The template is: https://www.roblox.com/library/17794699/Ragged-Pants and the pants are https://www.roblox.com/library/17794700/Ragged-Pants |
|
|
| Report Abuse |
|
|
| |
|
Excenal
|
  |
| Joined: 29 Jun 2011 |
| Total Posts: 80 |
|
|
| 20 Jul 2017 02:56 AM |
| i just helped you on your last post man |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2017 02:58 AM |
| Where should the "PlayerAdded" go? |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2017 02:58 AM |
| You wrote "PlayersAdded", it should be "PlayerAdded". |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2017 02:59 AM |
| Sorry but I tried what you said and it didn't work. |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2017 03:00 AM |
| Everything else seems right. Post what you have now. |
|
|
| Report Abuse |
|
|
Excenal
|
  |
| Joined: 29 Jun 2011 |
| Total Posts: 80 |
|
|
| 20 Jul 2017 03:00 AM |
local shirtid = " rbxassetid://17794699" local pantsid = "rbxassetid://17794699" game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) if character:findFirstChild("Pants") ~= nil then character.Pants.PantsTemplate = pantsid else local pants = Instance.new("Pants",character) pants.PantsTemplate = pantsid end if character:findFirstChild("Shirt") ~= nil then character.Shirt.ShirtTemplate = shirtid else local shirt = Instance.new("Shirt",character) shirt.ShirtTemplate = shirtid end end) end) --had a slight error in the first one, this should work |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2017 03:02 AM |
| @KnightmareXD I just changed the script as you said and it still doesn't work |
|
|
| Report Abuse |
|
|
Excenal
|
  |
| Joined: 29 Jun 2011 |
| Total Posts: 80 |
|
|
| 20 Jul 2017 03:03 AM |
| if you use mine, make sure you change the shirt id to whatever |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2017 03:04 AM |
This is what I have now:
local pantsID = "rbxassetid://17794699"
game.Player.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local pants = character:WaitForChild('Pants') pants.PantsTemplate = "rbxassetid://17794699" ..pantsID end) end) |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2017 03:04 AM |
| It should work. Excenal's looks fine as well, though you'll probably end up with two shirts/pants since it won't be there when the script checks, but loads later. Not sure which will render first. |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2017 03:05 AM |
Why did you change Pants Template? Use one or the other
local pantsID = "rbxassetid://17794699"
game.Player.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local pants = character:WaitForChild('Pants') pants.PantsTemplate = pantsID end) end) |
|
|
| Report Abuse |
|
|
Excenal
|
  |
| Joined: 29 Jun 2011 |
| Total Posts: 80 |
|
|
| 20 Jul 2017 03:05 AM |
local pantsid = "rbxassetid://17794699" game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) if character:findFirstChild("Pants") ~= nil then character.Pants.PantsTemplate = pantsid else local pants = Instance.new("Pants",character) pants.PantsTemplate = pantsid end end) end)
-- r u gonnas keep ignorning me |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2017 03:07 AM |
| I just tried @Excenals it works just fine, thanks for the help guys |
|
|
| Report Abuse |
|
|