This is my script, but I believe something is misplaced. Thoughts?
wait(5)
if Humanoid.Health<1 then
script.Parent.Parent.Door.Transparency= 1
script.Parent.Parent.Door.CanCollide= false
end
end
This is my script, but I believe something is misplaced. Thoughts?
wait(5)
if Humanoid.Health<1 then
script.Parent.Parent.Door.Transparency= 1
script.Parent.Parent.Door.CanCollide= false
end
end
Problem: Humanoid isn't defined. No events detected. Waiting is unnecessary.
Localscript in startergui:
repeat wait() until game.Players.LocalPlayer.Character
game.Players.LocalPlayer.Character.Humanoid.Died:Connect(function()
workspace.Door.Transparency = 1
workspace.Door.CanCollide = false
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
repeat wait() until game.workspace.Test -- Find Location
game.workspace.Test.Humanoid.Died:Connect(function() -- Location and Purpose
workspace.Door.Transparency = 1 -- Door Invisible
workspace.Door.CanCollide = false -- Door Walk Threw
end)
I'll accept your answer still for the help @greatneil80
Thanks bro
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Didn't work. I'm thinking because it's for LocalPlayer and not the NPC Humanoid, How would I do that?
workspace.NPC.Humanoid.Died