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

How do i check if a player is falling for x amount of time?

Asked by 5 years ago

Server script:

local firstpos
while wait() do
    for i,v in pairs(game.Workspace:GetChildren()) do
        if v:FindFirstChild("HumanoidRootPart") then
            if v.Humanoid.Sit == false then
            local person = v.HumanoidRootPart
            firstpos = person.Position
            wait(1)
            if (firstpos - person.Position).magnitude > 32 then
                print((firstpos - person.Position).magnitude)
                local player = game.Players:GetPlayerFromCharacter(person.Parent)
            player:Kick("silly u, im better")
                end
            end
            if v.Humanoid.Sit == true then
                local person = v.HumanoidRootPart
            firstpos = person.Position
            wait(1)
            if (firstpos - person.Position).magnitude > 166 then
                print((firstpos - person.Position).magnitude)
            local player = game.Players:GetPlayerFromCharacter(person.Parent)
            player:Kick("silly u, im better")
            end
            end
        end
        if v:FindFirstChild("Humanoid") then
            if v.Humanoid:GetState() == Enum.HumanoidStateType.Freefall then
                tick(3)
                print("fell for 3 sec")
            end
        end
    end
end

never used tick() but if i can remember it correctly from what i've seen its used to check something over time

0
tick() takes no arguments,it simply returns the number of seconds since the unix epoch (1/1/1970) User#24403 69 — 5y
0
ye ive only seen it be used but idk what to use Gameplayer365247v2 1055 — 5y
0
thats what i need help with, guesed it would maybe work Gameplayer365247v2 1055 — 5y

Answer this question