#HELPPP MY SCRIPT DOESNT WORK DOES ANYONE KNOW WHY

1 messages · Page 1 of 1 (latest)

winged glen
#

local button = script.Parent

local shirtId = "rbxassetid://987654321"

button.MouseButton1Click:Connect(function()

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local shirt = character:FindFirstChild("Shirt")

if not shirt then
    shirt = Instance.new("Shirt")
    shirt.Parent = character
end

shirt.ShirtTemplate = shirtId

end)

it just deletes the shirt the player was wearing

lilac nexusBOT
#

studio** You are now Level 1! **studio

river nacelle
#

It might just be that

winged glen
#

yes

river nacelle
#

Also I’d advise you to move the player variable outside the function

river nacelle
winged glen
#

yes!!

river nacelle
#

Can you try putting a shirt with that id on a blank r6 rig just to test

winged glen
#

okay i’ll try

#

one sec my computer powered off

river nacelle
#

Also I’d recommend switching FindFirstChild(“Shirt”) to FindFirstChildOfClass(“Shirt”)

#

So that the name won’t matter

winged glen
#

ohhh thank u

river nacelle
winged glen
#

i’m trying the r6 thing now

river nacelle
#

Alr

winged glen
#

wair one second sorru the code thete idnt the one i put it in that was an example

#

i already have codes so i tesy one of them instead

winged glen
river nacelle
#

Yeah that’s what I thought

#

Just make sure it’s the correct id

#

Did you upload the shirt

winged glen
#

i copied the link off the catalog

river nacelle
#

Show

winged glen
#

thay tbing

winged glen
lilac nexusBOT
#

studio** You are now Level 2! **studio

river nacelle
#

Yeah put that on the rig

winged glen
#

yeah i did

river nacelle
winged glen
#

nope

#

WIATTT

#

IT DID MB

river nacelle
#

You’re not putting the whole url right

#

Just the id

winged glen
#

SORRY

river nacelle
#

😭

winged glen
#

i put the clothing on the torso bye 😭

#

hahahah

#

okay i fixed it so yeah it works on the rig now what

river nacelle
#

Now that we know it works you can try putting the raw id in the script

#

Or the id that it changed to

winged glen
#

okay

#

nope

#

didn’t work

river nacelle
#

Which

winged glen
#

i added rhe id it changed to which was like rbxassetit://number

#

and i put it in the script

#

tested it and it just removed my shitt stoll

#

shirt

#

do u want to just get added to the game brcause it might be smth ive dkne wrong which i don’t know abt

river nacelle
winged glen
#

the one it changed to

river nacelle
#

Try the one from the catalog

winged glen
#

on it

river nacelle
winged glen
#

did not work

#

hahah it’s fine i can just add u thrn u csn check tmmr or smth??

river nacelle
#

Oh wait

#

It won’t even show the shirt to other people because it’s on the client

#

I mean that might be why it’s not showing but I really doubt it

#

You should put it on the server though

winged glen
#

wait sorry what

river nacelle
winged glen
#

yeah but what do i actuallt neef to do

white hound
#

💔

cloud bloom
white hound
#

m

#

i meant

#

they said rbxassetit://

#

in the replied message

#

idk if they changed anything in the code after that

cyan flume
#

Did you do this in a local script ? If so you need a remote event to pass it to the server. The way I did this works.

#

With a local script in the button gui and a script in SSS and a remote event in replicated storage

winged glen
winged glen
hallow badge
lilac nexusBOT
#

studio** You are now Level 1! **studio

hallow badge
#

local button = script.Parent

local shirtId = "rbxassetid://987654321"

button.MouseButton1Click:Connect(function())

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local shirt = character:FindFirstChild("Shirt")

if not shirt then
    shirt = Instance.new("Shirt")
    shirt.Parent = character
end

shirt.ShirtTemplate = shirtId

end)

#

u gotta add 2 ) at line 5 not just 1

cloud bloom
winged glen
hallow badge
hallow badge
winged glen
#

woukd anyone want to be added to the game an take a look at whats wrong with?

hallow badge
#

Ill check it out tmr

#

My user is linked with my acc

winged glen
#

kay