So I made a button script where when you would press the button a accessory would spawn on you and it would change your clothes. Problem is everytime I press the button I get this error saying that the request failed and it was an unexpected url. It seemed to work fine, when I started scripting this. But now when I decide to change the url it decides to not work. BTW the url is moderated.
game.ReplicatedStorage.EventStorage.Outfit1.OnServerEvent:Connect(function(plr)
local MWeb = game.ReplicatedStorage.EventStorage.MWeb
local Storage = game.ReplicatedStorage.TeamU.Web
local char = plr.Character
if not char then return end
if char:FindFirstChild("Humanoid") then
for _, child in pairs(char:GetChildren()) do
if child:IsA("Accessory") and child.Handle.AccessoryWeld.Part1 == char.UpperTorso then
child:Destroy()
end
end
local neweb = Storage:Clone()
neweb.Parent = char
for i,kin in pairs(neweb:GetChildren()) do
kin.Anchored = true
end
char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=5054296838"
char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=4514950550"
end
end)
Note* Take a look at the bottom where it changes the shirt template and pants.
