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

How do I make it so I auto equip my tool?

Asked by 4 years ago

Could anyone help me make it so when people spawn they don't have to click 1 to hold their Linked Sword? Please help me on this I can't find this anywhere. Thank you!

0
This is not a request site... c0nc3rt 61 — 4y

1 answer

Log in to vote
0
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

I’ve got nothing else to do, so I’ll give it to him anyway. Though, remember, this is not a request site as mentioned. Not a lot of people will be willing to give you the answer you desire if you didn’t try first.

—ServerScript in ServerScriptService

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(Player)
    local Character = Player.Character or Player.CharacterAdded:Wait()
    if (Character) then
        local Backpack = Player:FindFirstChild("Backpack")
        local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
        if (Backpack and Humanoid) then
            local Tool = Backpack.Tool
            Humanoid:EquipTool(Tool)
        end
    end
end)

If you have any questions about how this program works, don’t hesitate to ask in the comments below. If this works for you, it would be appreciated if you accept the answer.

Ad

Answer this question