I want to be able to change clothing in a server script through pressing a textbutton.
I literally have no clue where to start.
I looked on the developer hub and learned a bit more about RemoteEvents but still can’t figure out how to change clothing from a server script
I’m trying to make it so that the clothing will show up on the server and not just the client.
I don’t need a script just somewhere to start.
I recommend to change player’s clothe with new clothe not changing id
RemoteEvent | Documentation - Roblox Creator Hub – Get the Client → Server
-- LocalScript
script.Parent.MouseButton1Click:connect(function()
yourremoteevent:FireServer()
end)
-- Regular Script
yourremoteevent.OnServerEvent:Connect(function(player)
local character = player.Character
-- and then remove old clothes and replace with new one "i don't recommend to changing clothe's id"
end)
Start by creating a Client to Server RemoteEvent. (Assuming this is what you want)
From there on the servers OnServerEvent Function have it set the ID of the players existing clothing (Alternatively you can delete the existing clothes in the character and then replace it with new instances of clothing with the ID of the clothes already added in them)
If you want this function to be able to used with more then one article of clothing you can add a parameter which you pass to the Remote Event with the ID and then use the ID on the Server.