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 » Scripters
Home Search
 

Re: change pants Script

Previous Thread :: Next Thread 
jimmy1965gt is not online. jimmy1965gt
Joined: 07 Jan 2016
Total Posts: 16
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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
20 Jul 2017 02:54 AM
Should be "PlayerAdded"
Report Abuse
Excenal is not online. 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
jimmy1965gt is not online. jimmy1965gt
Joined: 07 Jan 2016
Total Posts: 16
20 Jul 2017 02:58 AM
Where should the "PlayerAdded" go?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
20 Jul 2017 02:58 AM
You wrote "PlayersAdded", it should be "PlayerAdded".
Report Abuse
jimmy1965gt is not online. jimmy1965gt
Joined: 07 Jan 2016
Total Posts: 16
20 Jul 2017 02:59 AM
Sorry but I tried what you said and it didn't work.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
20 Jul 2017 03:00 AM
Everything else seems right. Post what you have now.
Report Abuse
Excenal is not online. 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
jimmy1965gt is not online. jimmy1965gt
Joined: 07 Jan 2016
Total Posts: 16
20 Jul 2017 03:02 AM
@KnightmareXD I just changed the script as you said and it still doesn't work
Report Abuse
Excenal is not online. 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
jimmy1965gt is not online. jimmy1965gt
Joined: 07 Jan 2016
Total Posts: 16
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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. 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
jimmy1965gt is not online. jimmy1965gt
Joined: 07 Jan 2016
Total Posts: 16
20 Jul 2017 03:07 AM
I just tried @Excenals it works just fine, thanks for the help guys
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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