How would I make a script that gave certain people a certain tool?

How can I make a script that gives moderators, named billy and bob, for example, an exclusive moderator tool that only they can use in game?

1 Like

I got similar script for this thing.

Code:

local tool = --Location of the tool
local allowed = {1231212, 123123213} -- Player ID

local function identify(thisPlayer)
    for _, current in pairs(allowed) do
        if current == thisPlayer.PlayerId then
            return true
        end
    end
end

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        if identify(player) then
            tool:Clone().Parent = player.Backpack
        end
    end
end
3 Likes

In the first line, where you say local tool, if the tool is named tool1, for example, would local tool1 work?

Yes

local tool = game.Lighting:WaitForChild("Ultimate Long Sword") -- Example if the tool is located in Lighting

Okay, thank you. [minimum amount of characters lol]

1 Like