Touched event from the part works for 3 times, then stops working?
Asked by
6 years ago Edited 6 years ago
im making a water script (please dont ask why) and its supposed to use a bodyposition to make it float. It does work but for some reason it only works for 3 times, and sometimes it doesnt even work.. why?
02 | script.Parent.Touched:Connect( function (hit) |
04 | if hit.Parent.Torso then |
06 | local yes = game.Players:GetPlayerFromCharacter(hit.Parent) |
07 | game.Workspace.deletethingy:FireClient(yes) |
09 | local e = Instance.new( "BodyPosition" ) |
11 | e.Parent = hit.Parent.Torso |
12 | e.MaxForce = Vector 3. new( 4000 , 4000 *e.Parent.Parent.UpDownMultiplier.Value* 10 , 4000 ) |
13 | local m = game.Lighting.waterscript:Clone() |
20 | script.Parent.TouchEnded:Connect( function (hit) |
22 | if hit.Parent.Torso then |
24 | local e = hit.Parent.Torso:WaitForChild( "Water" ) |