I know it has been done before, but I am curious how. I currently have a setup which doesn't work:
script.Parent.RemoteFunction.OnServerInvoke = function(plr, val)
print("start")
val = string.split(val, ",")
script.Parent.val1.Value = val[1]
script.Parent.val2.Value = val[2]
repeat
local success, response = pcall(function()
workspace.test.shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..script.Parent.val1.Value
end)
if not success then
script.Parent.val1.Value = script.Parent.val1.Value - 1
end
until success
repeat
local success, response = pcall(function()
workspace.test.pants.PantsTemplate = "http://www.roblox.com/asset/?id="..script.Parent.val2.Value
end)
if not success then
script.Parent.val2.Value = script.Parent.val2.Value - 1
end
until success
script.Parent.Dummy.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..script.Parent.val1.Value
script.Parent.Dummy.Pants.PantsTemplate = "http://www.roblox.com/asset/?id="..script.Parent.val2.Value
end
