Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

7 comments

0

How would I implement it into this script?

0

Is it a local script?

0

No.

0

Woah o.0 why so many dislikes on my comment? I didnt request a script e.e

0

Is the script a button in a part, or a gui?

0

The script is in a Textbutton

0

Mk, Well copy the hole script and paste it into a local script instead then do what i showed

This discussion is preserved as it was. New answers, comments, and votes are closed.