Okay so this local script is in a textbutton, which is part of a frame in a screenGUI, which in starterGUI. It is supposed to give clothes when you click it but it isn't doing anything when I test. Anyone know?
script.Parent.MouseButton1Down:connect(function() playername = script.Parent.Parent.Parent.Parent.Name player = Workspace:FindFirstChild(""..playername.."") if player ~= nil then player:FindFirstChild("Pants").PantsTemplate = "http://www.roblox.com/asset/?id=304161831" -- Pants ID here player:FindFirstChild("Shirt").ShirtTemplate = "http://www.roblox.com/asset/?id=304161802"-- Shirt ID here end end)
One of the big benefits of using LocalScripts is that you can access the LocalPlayer. This can be done using game.Players.LocalPlayer. Whatever variable you set to that will pretty much be set to the player with the Gui inside of him (every player in this instance as the Gui is in StarterGui).
Using this, you can get the Player's model in Workspace using 'game.Players.LocalPlayer.Character' or 'player.Character'. From here you can pretty much do whatever with the player.
e.g. "game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 100"
local player = game.Players.LocalPlayer script.Parent.MouseButton1Down:connect(function() player.Character:FindFirstChild("Pants").PantsTemplate = "http://www.roblox.com/asset/?id=304161831" -- Pants ID here player.Character:FindFirstChild("Shirt").ShirtTemplate = "http://www.roblox.com/asset/?id=304161802"-- Shirt ID here end)
Edit: Removed extra 'end'