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

Most efficient way to not tie with fencing foils? ( Fencing + )

Asked by 10 years ago

So I'm wondering what the best theory it would be to make a sword, that will not tie, but will not be like "First encounter wins". Does anyone understand the theory? If so please do help me out here.

1 answer

Log in to vote
0
Answered by
jav2612 180
10 years ago

You're probably going to want to make an event that detects when a player dies, save a tick() of when it happens and if another player does you can compare the tick()'s to see which died first. Unless they died at precisely the same time this should be an extremely accurate way of determining who died first.

Example script:

lastdeath = nil
deathtime = nil

function CharacterDied(char)
    lastdeath = char
    deathtime = tick()
end

function PlayerAdded(player)
    player.CharacterRemoving:connect(CharacterDied)
end

game:GetService("Players").PlayerAdded:connect(PlayerAdded)

That should give you the character that died last and their time of death so you can compare them to see who died first. If you want you can put all the times and deaths into tables to compare them easier.

0
I have no idea how I would do that. Wrongmistake 0 — 10y
Ad

Answer this question