Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Any ways to put a certain hat on certain people?

Asked by 5 years ago

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?

0
Remember this is not a request site. Allow people to see the error in your scripts to fix it. :) terence404 19 — 5y
0
@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. AIphanium 124 — 5y

2 answers

Log in to vote
0
Answered by
Delude_d 112
5 years ago
--------- 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)

0
I know it's not a request site, but, it was easy to make. I gave him an idea how to make it.. Delude_d 112 — 5y
0
Any proof on... " it was easy to make? " :) AIphanium 124 — 5y
0
Wdym lol. That's like the basic of roblox scripting Delude_d 112 — 5y
Ad
Log in to vote
-1
Answered by 5 years ago

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. :) `

0
That script would error to hell LMAO User#19524 175 — 5y
0
lmao KawaiiX_Jimin 54 — 5y

Answer this question