Someone please help me I dont know why this script doesnt work
01 | local Players = game:GetService( "Players" ) |
02 | Players.PlayerAdded:Connect( function (player) |
03 | local Player = game.Players.LocalPlayer |
04 | local Character = Player.Character |
05 | local Shirt = Character:FindFirstChild( "Shirt" ) or Instance.new( "Shirt" , Character) -- if its in character then get shirt else make a new one |
06 | local Pants = Character:FindFirstChild( "Pants" ) or Instance.new( "Pants" , Character) |
07 |
08 | local shirtId = "https://www.roblox.com/catalog/1303497675/Prison-Prison-Prison-Prison-Prison-Prison-Prison" -- put the shirt id here |
09 | local pantsId = "https://www.roblox.com/catalog/1280655173/Prison-Prison-Prison-Prison-Prison-Prison-Prison" -- put the pants id here |
10 |
11 | Shirt.ShirtTemplate = "rbxassetid://" ..shirtId -- set the shirt |
12 | Pants.PantsTempalte = "rbxassetid://" ..pantsId -- set the pants |
13 | end ) |
Please help Ive also tried only putting the ID onstead of the full link but it still doesnt work!
I see your problem. Your basically adding the whole roblox link onto the shirts template, instead of just the number. You should have also used a character added script. You can't use local player on a server script. Put this script in server script service. Here is your fixed script:
01 | local Players = game:GetService( "Players" ) |
02 | Players.PlayerAdded:Connect( function (player) |
03 | player.CharacterAdded:Connect( function (char) |
04 | local Player = player |
05 | local Character = char |
06 | local Shirt = Character:FindFirstChild( "Shirt" ) or Instance.new( "Shirt" , Character) -- if its in character then get shirt else make a new one |
07 | local Pants = Character:FindFirstChild( "Pants" ) or Instance.new( "Pants" , Character) |
08 |
09 |
10 | Shirt.ShirtTemplate = "rbxassetid://1303497675" |
11 | Pants.PantsTemplate = "rbxassetid://1280655173" |
12 | end ) |
13 | end ) |
In fact i used a local script and i also tried not adding the whole thing i guess the problem was the fact that the script wasnt character added but thanks! Edit: there is a problem, there is no such thing as a server script storage