Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
Edited 5 years ago

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

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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.

0
u sure? PaliKai13 92 — 5y
0
did it even worse PaliKai13 92 — 5y
0
ye i risked it a bit TheluaBanana 946 — 5y
0
blindly answering ur question TheluaBanana 946 — 5y
View all comments (4 more)
0
however TheluaBanana 946 — 5y
0
no offense but after scrutinizing ur answer such a fall script although compact might not be so functionable TheluaBanana 946 — 5y
0
so instead of resolving it i will attempt to make a better script to suit such a purpose TheluaBanana 946 — 5y
0
when i have the time.. TheluaBanana 946 — 5y
Ad

Answer this question