How do i change player’s shirt and pants by clicking a GuiButton.
3 Likes
LocalScript:
local gui = script.Parent.GuiButton
local player = game.Players.LocalPlayer
local char = player.Character
game.ReplicatedStorage.RemoteEvent:FireServer(char)
ServerScript:
local shirtId = rbxassetid://idhere
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player, char)
char.Shirt.ShirtId = ShirtId
end)
Try this code. Make sure to add a remote event.
1 Like
There is 2 flaws I see in @RainbowBacon 's script.
- The clothing templates take the format of ‘rbxassetid://idhere’ and not just the id
- You need the DecalId of the shirt, the templateid, not the shirt id
2 Likes
Oof lemme fix those problems. Thanks for informing me.