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

Why does my script keep killing the player when they spawn?

Why does my script keep killing the player when they spawn?

This is a local script in StarterCharacterScripts.

It is supposed to kill the player when they hit the ground at over 10 Velocity.Y.

local Char = script.Parent

for _,v in pairs(Char:GetChildren())do
	if v:IsA("BasePart") then
		v.Touched:Connect(function()
			if Char.UpperTorso.Velocity.Y >= 10 then
				Char:FindFirstChild("Humanoid").Health = 0
			end
		end)
	end
end

1 answer

u should use

<=

instead of

>=

cus what its doing right now is that its killing u if u r not travelling at a Y velocity of over or equal to 10.

8 comments

0

u sure?

0

did it even worse

0

ye i risked it a bit

0

blindly answering ur question

0

however

0

no offense but after scrutinizing ur answer such a fall script although compact might not be so functionable

0

so instead of resolving it i will attempt to make a better script to suit such a purpose

0

when i have the time..

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