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
 

How to give characters specific shirts and pants on joining

Previous Thread :: Next Thread 
soniclover88888 is not online. soniclover88888
Joined: 01 Feb 2008
Total Posts: 6723
09 Apr 2015 04:44 PM
I need a script that, once you join and every time you respawn, you get a certain outfit. What process would I use for this and how would I work my way about it?
Report Abuse
soniclover88888 is not online. soniclover88888
Joined: 01 Feb 2008
Total Posts: 6723
09 Apr 2015 05:27 PM
B!
Report Abuse
Seattlantis is not online. Seattlantis
Joined: 24 Jul 2013
Total Posts: 5560
09 Apr 2015 05:37 PM
assetPants = "Pants assetId here"
assetShirt = "Shirt assetId here"

repeat wait() until game.Players.LocalPlayer
repeat wait() until game.Players.LocalPlayer.Character

char = game.Players.LocalPlayer.Character
p = char:findFirstChild("Pants")
s = char:findFirstChild("Shirt")


game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
if p then
p.PantsTemplate = assetPants
elseif p == nil then
local e = Instance.new("Pants")
e.Parent = char
e.PantsTemplate = assetPants
end
if s then
s.ShirtTemplate = assetShirt
elseif s == nil then
local e = Instance.new("Shirt")
e.Parent = char
e.ShirtTemplate = assetShirt
end
end)
end)
Report Abuse
soniclover88888 is not online. soniclover88888
Joined: 01 Feb 2008
Total Posts: 6723
09 Apr 2015 07:01 PM
I tried your script and added on to it;

assetPants = 158036763
assetShirt = 157974597
char = game.Players.LocalPlayer.Character
p = char:findFirstChild("Pants")
s = char:findFirstChild("Shirt")

repeat wait() until game.Players.LocalPlayer
repeat wait() until char

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
if p then
p.Appearance.PantsTemplate = "http://www.roblox.com/asset/?id=" .. assetPants
elseif p == nil then
local e = Instance.new("Pants")
e.Parent = char
e.Appearance.PantsTemplate = "http://www.roblox.com/asset/?id=" .. assetPants
end
if s then
s.Appearance.ShirtTemplate = "http://www.roblox.com/asset/?id=" .. assetShirt
elseif s == nil then
local e = Instance.new("Shirt")
e.Parent = char
e.Appearance.ShirtTemplate = "http://www.roblox.com/asset/?id=" .. assetShirt
end
end)
end)

But it did not work. Any help?
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
09 Apr 2015 07:03 PM
I am tired of writing the same piece of code over and over for each person that asks about this.

There are models and plugins about this you can read the code on and learn from. Go look. ._.

-The [Guy]
Report Abuse
soniclover88888 is not online. soniclover88888
Joined: 01 Feb 2008
Total Posts: 6723
09 Apr 2015 07:09 PM
Thanks for the enlightening, interesting and super responsive answer. This 100% helped me to solve the problem, especially since it used a method I tried doing twice before posting this thread but yet yielded no results. What a fantastic reply! I think you deserve some sort of commendation for this post.
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
09 Apr 2015 07:14 PM
I am tired of writing the same piece of code over and over for each person that asks about this.

There are models and plugins about this you can read the code on and learn from. Go look. ._.

-The [Guy]
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
09 Apr 2015 07:15 PM
^Fail double post, sorry :3 It said flood check or whatever. So I clicked it again. :P

-The [Guy]
Report Abuse
soniclover88888 is not online. soniclover88888
Joined: 01 Feb 2008
Total Posts: 6723
09 Apr 2015 07:15 PM
Now not only once, but twice! Your problem solving methods are just as good as your helping methods!
Report Abuse
soniclover88888 is not online. soniclover88888
Joined: 01 Feb 2008
Total Posts: 6723
09 Apr 2015 07:17 PM
Oh. My bad on the insult.
Report Abuse
soniclover88888 is not online. soniclover88888
Joined: 01 Feb 2008
Total Posts: 6723
09 Apr 2015 07:24 PM
Got it.
Report Abuse
rileySK3 is not online. rileySK3
Joined: 16 Feb 2013
Total Posts: 94
09 Apr 2015 07:27 PM
HAHAHA LOL
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