I want to make a hat remover script that removes all your hats when you touch a part.
COMMUNITY QUESTION
How to create a hat remover script?
1 answer
Rule 3 of the community guidelines states:
- Answers must show reasonable attempt to solve the question. --> Explain what went wrong. --> Provide code as an example. Include the explanation of the code.
As for your question, I'll answer it, but don't repeat this.
local playerName = "ROBLOX"
local player = game:GetService("Players"):FindFirstChild(playerName)
if player and player:IsA("Player") then
local char = player.Character
if char then
local hum = char:FindFirstChildWhichIsA("Humanoid")
if hum then
hum:RemoveAccessories()
end
end
end
The player's humanoid has a method called RemoveAccessories().
Call that, it will remove their hats.
Don't repeat this style of question in future, please.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
https://scriptinghelpers.org/help/community-guidelines
I did that this is a question!!