Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
xelnu 2
3 years ago
Edited by appxritixn 3 years ago

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.

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. appxritixn 2235 — 3y
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. RektwayYTB 123 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

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

Ad
Log in to vote
-1
Answered by 3 years ago
Edited 3 years ago

When answering, if your answer does not fully solve the question, it should be written as a comment to the question instead of as an answer.

use the rbxassetid://

Answer this question