In my code i tried to make it so that when a button is clicked, it changes the local player with whatever id they typed in.However, the code just stops half way through with no roblox error. I am really confused.
local wear = script.Parent.Parent:WaitForChild("WearButton") --button adress
local player = game.Players.LocalPlayer -- local player will be used for both of the following segments --local player
wear.MouseButton1Click:connect(function()
local Id = script.Parent.Text -- inputted id
local assetLink = ("https://www.roblox.com/Thumbs/Asset.ashx? width=110&height=110&assetId="..Id) --asset link, includes ID
print ("Got to this part at least!")
local avatarchange = player:GetChildren()-- Getting the children of player
for i=1, #avatarchange do
if (avatarchange[i].className == "Pants") then
print("Got to finding Pants")
avatarchange[i].PantsTemplate = assetLink -- Not working.... idk why :( , might be the for function itself...
print("Pants have been succesfully worn")
end
end
end)
print("Passed InsertService for Asset")
Thanks for your help in advance!

1 comment
Edited my answer. I know it now!