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

How in code, would you create a function that calls, and tells the computer to anti tie?

Asked by 10 years ago

How in code, would you create a function that is called, on death and inside the function, it plays "No ties".

1 answer

Log in to vote
0
Answered by
Ekkoh 635 Moderation Voter
10 years ago

I have no idea what you mean by "plays No ties" but to call a function on death you'll want to do something like this-

function Died(char)
    print(char.Name .. " died.")
    -- play "No ties."?
end

Game:GetService("Players").PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(char)
        char:WaitForChild("Humanoid").Died:connect(function()
            Died(char)
        end)
    end)
end)
Ad

Answer this question