Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

GUI button not giving local player clothing? I need help please!

My code is:

script.Parent.MouseButton1Down:connect(function()
	local playername = game.Players.LocalPlayer.Name
	local player = workspace:FindFirstChild(""..playername.."")
	if player ~= nil then
		player:FindFirstChild("Pants").PantsTemplate = "http://www.roblox.com/asset/?id=7133612447" 
		player:FindFirstChild("Shirt").ShirtTemplate = "http://www.roblox.com/asset/?id=7133614237"
	end
end)

No Idea why this is not working, all it's doing is removing my clothing instead of giving me the new clothing.

2 comments

0

When asking/answering a question, be sure to encase your code in the Lua tags (Look for the Lua icon in the formatting tab). I did it for you this time.

0

Actually, Try to wear the shirt on the NPC, It will give the new ID, Paste the new ID from the Object to the shirt ID.

2 answers

✓ Accepted answer

LocalScripts can't change things that other players can see. Other players see clothing, so you will need to use remote events for this

This discussion is preserved as it was. New answers, comments, and votes are closed.