This is my script, but I believe something is misplaced. Thoughts?
1 | wait( 5 ) |
2 |
3 | if Humanoid.Health< 1 then |
4 |
5 | script.Parent.Parent.Door.Transparency = 1 |
6 | script.Parent.Parent.Door.CanCollide = false |
7 | end |
8 | end |
Problem: Humanoid isn't defined. No events detected. Waiting is unnecessary.
Localscript in startergui:
1 | repeat wait() until game.Players.LocalPlayer.Character |
2 | game.Players.LocalPlayer.Character.Humanoid.Died:Connect( function () |
3 | workspace.Door.Transparency = 1 |
4 | workspace.Door.CanCollide = false |
5 | end ) |
Try it, tell me if it doesn't work, if it does work, please click the answer button, Thanks
I figured out the solution
1 | repeat wait() until game.workspace.Test -- Find Location |
2 | game.workspace.Test.Humanoid.Died:Connect( function () -- Location and Purpose |
3 | workspace.Door.Transparency = 1 -- Door Invisible |
4 | workspace.Door.CanCollide = false -- Door Walk Threw |
5 | end ) |
I'll accept your answer still for the help @greatneil80