So I have a gui that when you click a button in it, it changes the players shirt/pants to the id I specified in the script. The problem is that it is a local script (since its in a gui) so only the player who clicked it can see it. How can I turn this into a server script?
-- Shirt --
script.Parent.MouseButton1Click:connect (function ()
playername = script.Parent.Parent.Parent.Parent.Parent.Parent.Name
player = Workspace:FindFirstChild(""..playername.."")
if player ~= nil then
player:FindFirstChild("Shirt").ShirtTemplate = "http://www.roblox.com/asset/?id=318964409"
end
end)

1 comment
so aside from puting a remote event in the button and firing it, what do I need to do?