How to change clothes every time player spawns?
Hi, i've been trying to make it so that every time a character spawns, their pants turn into this:
https://www.roblox.com/catalog/3327167553/Green-Pajamas.
However, I've been trying lots of different things but i'm way too inexperienced with Roblox Studio/Lua scripting to know what i'm doing (This is my first time attempting to script on Roblox/Lua ever).
Where should I put my code to make this happen? What should my code be? What kind of script (local, regular, etc) do I need to use to make this happen?
My main attempt was this:
01 | local function givePajamas(player) |
02 | local character = player.Character |
05 | local pants = character:FindFirstChildOfClass( "Pants" ) |
08 | pants = Instance.new( "Pants" , character) |
I put this code as a local script inside of StarterCharacterScripts. I tried to use the ROBLOX Dev API Reference on their website to help me out (which is where I got the bulk of this code from) but nothing has seemed to work.
Appreciate any help, thank you very much!