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 » Scripting Helpers
Home Search
 

Re: changing player shirt

Previous Thread :: Next Thread 
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
18 Jul 2014 02:33 PM
How would I change a player shirt in game using a gui? Would I put a shirt template in the gui aand when gui is clicked it would change the player shirt?
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
18 Jul 2014 02:47 PM
sure :D
Report Abuse
azabat is not online. azabat
Joined: 28 Mar 2008
Total Posts: 29
18 Jul 2014 03:02 PM
Parent structure
Players -> Player -> PlayerGui -> ScreenGui -> GuiButton ->Script

Make a shirt object with the AssetID and put it into the Lighting. Name it something (In this case, I named it ShirtNameGoesHere)

Put this inside the GuiButton

player = script.Parent.Parent.Parent.Parent.Character
debounce = true
function onClick()
if debounce ~= true then return end
debounce = false
for i,v in pairs(player:GetChildren()) do
if v:IsA("Shirt") then
player:findFirstChild("Shirt"):Destroy()
end
end
game.Lighting.ShirtNameGoesHere:clone().Parent = player
debounce = true
end
script.Parent.MouseButton1Click:connect(onClick)
Report Abuse
azabat is not online. azabat
Joined: 28 Mar 2008
Total Posts: 29
18 Jul 2014 03:05 PM
Oh yeah, you could probably just keep the Shirt object inside the GuiButton.

So you could change
game.Lighting.ShirtNameGoesHere:clone().Parent = player
to
script.Parent.ShirtNameGoesHere:clone().Parent = player
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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