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

Why is this script not checking weapons & it says no one survived?

Asked by 10 years ago
    for _,v in pairs(Check) do
        local found = false
        local BKP = v.Backpack:GetChildren()
        for __,x in pairs(BKP) do
            if x.Name == "BeginnerSword" then
                found = true
                v.Character.Torso:Destroy()
            end
        end
        if found == true then
            table.insert(Names,v.Name);
            H.Text = table.concat(Names,", ") .. " has survived being a pirate!"
            wait(5)
            H.Text = "Hurray! Thanks for playing, version 1.05~"
            wait(3)
            Re_Text()
        elseif found == false then
            H.Text = "No one has survived. Game restarting, version 1.05!"
            wait(5)
            Re_Text()
        end
    end
end

It skips the check completely if there is like two players and then says that no one survived when clearly some people did. Why?

1 answer

Log in to vote
0
Answered by
Defcon0 10
10 years ago

You did not include how much damage it does to the character. You need to make sure the script kills the character if you wish for it to do that. If you want to kill them after a specific period of time, Run a timer in the script after a specific action has been done, like someone activates a start GUI, or all the characters die, then run the script, wait however many minutes, then the game starts again. I want you to use this knowledge to script it out yourself, increases your skill sets to prevent any future incident like this!

Ad

Answer this question