I am trying to make it to where you click a GUI button it gives your player shirt and pants, but it doesn’t seem to be working. Any ideas?
Local Script:
local button = script.Parent
local player = game.Players.LocalPlayer
local remote = script.Parent.RemoteEvent
button.MouseButton1Click:Connect(function(player)
remote:FireServer(player)
end)
This might have to do with a permission problem. Did you publish the shirt, or do you own them? The same thing happens with animations.
Oh… I see. I don’t think you understand how the MouseButton1Click event works. It doesn’t pass a player argument. You might want to remove the declaration on line 5 in the local script, and you don’t need to pass your own player in the event, that’s automatically provided. You’re probably indexing nil on the server when you say .Character.
since it looks like a localscript is controlling the gui button, you don’t need to fire the clicker through the remote. the first parameter will always be the client that fired the event, even without passed variables. on the serverside, the input would look like this