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

Why will this .Died function not work?[Solved]

Asked by 10 years ago

This is a script to go along with my GUI that makes you need to input the correct password to get into the game.

tries = 0

function onButton1Down()
local passwordvalue = script.Parent.Parent.Password.Value
if script.Parent.Parent.TextBox.Text == passwordvalue or script.Parent.Parent.TextBox.Text == passwordvalue:lower() or script.Parent.Parent.TextBox.Text == passwordvalue:upper() then
script.Parent.Parent.Right.Visible = true
script.Parent.Parent.Status.Visible = false
wait(1)
script.Parent.Parent.Parent.Visible = false
else script.Parent.Parent.Status.Text = "Wrong Passcode"
    tries =tries +1

    script.Parent.Parent.Status.Visible = true
    wait(0.1)
    script.Parent.Parent.Status.Visible = false
    wait(0.1)
    script.Parent.Parent.Status.Visible = true
    wait(0.1)
    script.Parent.Parent.Status.Visible = false
    wait(0.1)
    script.Parent.Parent.Status.Visible = true
 if tries == 7 then
    script.Parent.Parent.Status.Text = "Incorrect too many times!"
    wait(1)
    script.Parent.Parent.Status.Text = "You are locked out!"
    wait(1)
    script.Parent.Parent.Status.Text = "Incorrect to many times!"
    wait(1)
    script.Parent.Parent.Status.Text = "You are locked out!"
    wait(1)
    script.Parent.Parent.Status.Text = "Incorrect to many times!"
    wait(1)
    script.Parent.Parent.Status.Text = "You are locked out!"
    wait(1)
    script.Parent.Parent.Password:Destroy()
    script.Parent.Parent.TextBox:Destroy()
    script.Parent.Parent.GameLocked.Script:Destroy()
    wait(0.1)
    script.Parent.Parent.GameLocked.Text = "Locked Out! Bye Bye!"
    function died()
    wait(3)
    script.Parent.Parent.Password:Destroy()
    script.Parent.Parent.Submit:Destroy()
    end
end
end

end


script.Parent.MouseButton1Down:connect(onButton1Down)
script.Parent.Parent.Parent.Parent.Parent.Parent.Died:connect(died) --This target would be a player in the "Players" folder.

1 answer

Log in to vote
2
Answered by 10 years ago

To access .Died you have to do Player.Character.Humanoid.Died:connect

0
How would I implement it into this script? My_Comment 95 — 10y
0
Is it a local script? xImmortalChaos 565 — 10y
0
No. My_Comment 95 — 10y
0
Woah o.0 why so many dislikes on my comment? I didnt request a script e.e My_Comment 95 — 10y
View all comments (3 more)
0
Is the script a button in a part, or a gui? xImmortalChaos 565 — 10y
0
The script is in a Textbutton My_Comment 95 — 10y
0
Mk, Well copy the hole script and paste it into a local script instead then do what i showed xImmortalChaos 565 — 10y
Ad

Answer this question