Ive tried some before but none seem to work.
Is there a script that could let you remove someones hats on entry and then give them a new one? :P
1 answer
Perci1 is absolutely right, this forum is not for Script requests at all! Regardless, I like helping people out so here you are.
I generally would give a very healthy, informative reply, but this one wont be since it's a request. I will explain briefly what I did and that's all.
First things first, I put a hat in replicatedstorage and named it 'Hat'. I then made a assigned hat to a variable named hat. I then created two anonymous functions, a PlayerAdded(Fires when a player enters the game) and a CharacterAdded(Fires when a character is added. A Character is added each time a player respawns.) event. I then waited three seconds(I'll explain this later).
Afterwards, I checked if the char, the plr and if the Humanoid weren't nil. I then wanted to irritate through all the items in the 'Char:GetChildren()' table, so I decided to use a for pairs loop. You can read more on for pairs loops here . I then used the IsA() Method to check if the item was a hat, then I destroyed it if it was.
I then out of the for loop Cloned the hat and parented it to the character which would put the hat on the character.
Now, for the wait() part of the script, I put it there to wait for everything to be loaded. Generally, 3 seconds isn't enough. I know way more efficient ways of doing this, but since this was a script request i'm leaving it up to you to find a good well orientated efficient way of doing this!
Cheers!
local replicatedstorage = game:GetService("ReplicatedStorage")
local hat = replicatedstorage:WaitForChild("Hat")
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
wait(3)
if(char and plr and char:FindFirstChild("Humanoid")) then
for i, v in pairs(char:GetChildren()) do
if(v) then
if(v:IsA("Hat")) then
v:Destroy()
end
end
end
local clone = hat:Clone()
clone.Parent = char
end
end)
end)
Another way you could do this is make an alt account that you want everyone to look like and you could do this is change the character's CharacterAppearance property.
Their are various ways of doing many things.
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
This is Scripting HELPERS, if you don't want to learn and are only here for some free scripts, you've come to the wrong place.
If i know how to do stuff like this i can make my own scripts
lol
Perci be overreacting
No, you won't be able to because you won't know how anything works!
Kelime, no one is 'overreacting'. Look up the rules, and follow them.
https://scriptinghelpers.org/help/how-post-good-questions-answers