In ROBLOX, I have some people that work as admins in my game, but I want to give them certain hats, Kind of like a personal tools script. I have tried combining 2 scripts, but I am 99.9% sure that the backpack won't work with hats. Any help?
Any ways to put a certain hat on certain people?
2 answers
--------- works for me, try it!
admins = {
"Delude_d"
}
game.Players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function(c)
for _,v in pairs (admins) do
if p.Name == v then
local rep = game:GetService("ReplicatedStorage")
local hat = rep:WaitForChild("Hat"):Clone()
hat.Parent = c
end
end
end)
end)
3 comments
I know it's not a request site, but, it was easy to make. I gave him an idea how to make it..
Any proof on... " it was easy to make? " :)
Wdym lol. That's like the basic of roblox scripting
This seems pretty easy. First you will need to fire an event when the admins join in so. And a event for every time their player respawns. Then you get the names of the admins in a workspace:GetChildren parameter. Then get your stored hat(s) somewhere. I'm using game.Lighting to store the hat. So you then clone it and make the clone's parent the admin if they don't have the hat. If my script isn't perfect you should be able to fix some bits your self `~~~~~~~~~~~~~~~~~ game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char)
for i,v in pairs(workspace:GetChildren())do if v:FindFirstChild("Humanoid") and v.Name == "(Insert admin name)" or v.Name == "(Insert admin name)" and v:FindFirstChild("AdminHat") == nil then game.Lighting.AdminHat:Clone().Parent = v end end end end
Hopefully I helped. :)
`
2 comments
That script would error to hell LMAO
lmao
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Remember this is not a request site. Allow people to see the error in your scripts to fix it. :)
@terence404, Remember, this is not a site about telling people that " This is not a request site :) ", you HAVE to fix their problems, at least telling them what REALLY IS TRUE.