Need help with a shirt changing script

  1. What’s the problem?

I have this script where if you click your mouse your clothing will change into the scripts clothing, but it only shows in my screen and not anyone else’s.

  1. What do you want to achieve

I want to try and make it so the script will make everyone be able to see the clothes it gave you when you clicked your mouse.

local Pants = script.Parent.Pants
local Shirt = script.Parent.Shirt


local localPlayer = game.Players.LocalPlayer -- get the localPlayer
local mouse = localPlayer:GetMouse()
local Clicks = 0



Suit.Equipped:Connect(function()
	mouse.Button1Down:Connect(function()
		Clicks = Clicks + 1
		if Clicks == 1 then
			local character = localPlayer.Character or workspace:FindFirstChild(localPlayer.name)

			if character then


				for i,part in pairs(character:GetChildren())do
					if part:IsA("Pants") or part:IsA("Shirt") then

						part:Destroy()
					end
				end

				local NewPants = Pants:Clone()
				local NewShirt = Shirt:Clone()

				NewPants.Parent = character
				NewShirt.Parent = character

				local Sound = script.Parent["Shirt 2 (SFX)"]
				Sound:Play()
			end

		end



		if Clicks >= 2 then
			local character = localPlayer.Character or workspace:FindFirstChild(localPlayer.name)

			if character then


				for i,part in pairs(character:GetChildren())do
					if part:IsA("Pants") or part:IsA("Shirt") then

						part:Destroy()
					end
				end

				local OP = script.Parent.OPant
				local OS = script.Parent.OShirts




				local OldPants = OP:Clone()
				local OldShirt = OS:Clone()

				OldPants.Parent = character
				OldShirt.Parent = character

				local Sound = script.Parent["Shirt 2 (SFX)"]
				Sound:Play()


				script.Parent.Parent:Destroy()

			end
		end

	end)
end)

image

If anyone can help I’d very appreciate it!

you are changing the sirt on a local script, which only applies to the client so other players (“clients”) wont see it, what you need to do is to fire a remote event to the server to change the shirt. heres some reading + code example on it.

1 Like

Exactly like @mejackdaawesome2928 said (Sorry for notification), its because its a localscript, which runs on the client, and you should use a remote event to tell a normal script to change the shirt on the server.

1 Like