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

I was wondering If this script will give the badge whenever two players equip a specific tool?

Asked by 2 years ago

So here Is a script:

local Tool = script.Parent
local CanGive = false
local Debounce = false
local player

game.Players.PlayerAdded:Connect(function(client)
    player = client
end)

repeat wait() until player ~= nil

Tool.Equipped:Connect(function()
    CanGive = true
    if not Debounce then
        Debounce = true
        if player["Troll pan"].Equipped and Tool.Equipped and CanGive = true then
            Tool.Handle.Touched:Connect(function(hit)
                game.Players:GetPlayerFromCharacter(hit.Parent)
                game.BadgeService:AwardBadge(player. UserId, 2126102033)
            end)
        end
        wait(1.20)
        Debounce = false
        CanGive = false
    end
end)

Basically I'm making a badge that needs you to kill/one-shot a player holding the troll pan (Which Is a tool I made) using Skill (Another pan tool I made) but I don't know If this Is correct

Answer this question