of     1   

Geckopower
#141319556Wednesday, July 23, 2014 11:04 PM GMT

local t=false script.Parent.Touched:connect(function(c) if game.Players:GetPlayerFromCharacter(c.Parent)then local p=game.Players:GetPlayerFromCharacter(c.Parent) if c.Name=="Head"and t==false then t=true wait(15) repeat wait(1)c.Parent.Humanoid.Health=c.Parent.Humanoid.Health-5 until TouchEnded(game.workspace.ocean (c.Name=="Head"))--this line may be causing the problem end end end) coroutine.resume(coroutine.create(function() script.Parent.TouchedEnded:connect(function() t=false end) end )) It only damages me one time, and if i jump out of the water then jump back in, i don't take any more damage. Any help is great, thanks.
TehIcyStar
#141320331Wednesday, July 23, 2014 11:13 PM GMT

Just.... don't use touch ended. have a loop run to see if the head's position is under the ocean, and have the char take damage.
Geckopower
#141321708Wednesday, July 23, 2014 11:27 PM GMT

I changed line 8 to this == repeat wait(1)c.Parent.Humanoid.Health=c.Parent.Humanoid.Health-5 until Vector3.y <4.2 but it still does the same thing.
Geckopower
#141383027Thursday, July 24, 2014 1:23 PM GMT

Update: I changed the entire script to something more simple, but now I won't take damage at all: function onTouched(part) if game.Players:GetPlayerFromCharacter(c.Parent)then local h = part.Parent:findFirstChild("Humanoid") wait (15) while part.Parent:findFirstChild("Humanoid").CFrame.y < 8.6 do if h~=nil then h.Health = h.Health -5 wait(2) end end end end script.Parent.Touched:connect(onTouched) Can somebody help me out? Thanks.

    of     1