Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Kick = false
- --true to kick and false to teleport back and freeze.
- local EndEnums, StartEnums = {
- Enum.HumanoidStateType.RunningNoPhysics,
- Enum.HumanoidStateType.Running,
- Enum.HumanoidStateType.Landed,
- Enum.HumanoidStateType.Climbing,
- Enum.HumanoidStateType.Seated,
- Enum.HumanoidStateType.Jumping
- }, {
- Enum.HumanoidStateType.Landed,
- Enum.HumanoidStateType.Jumping,
- Enum.HumanoidStateType.Freefall,
- Enum.HumanoidStateType.FallingDown,
- Enum.HumanoidStateType.RunningNoPhysics,
- Enum.HumanoidStateType.Running,
- Enum.HumanoidStateType.Climbing
- }
- function check_enum(input, array)
- for i,v in pairs(array) do
- if input == v then
- return true
- end
- end
- return false
- end
- function Anchored(Bool, Root)
- for i,v in pairs(Root.Parent:GetDescendants()) do
- if v:IsA'BasePart' then
- v.Anchored = Bool
- end
- end
- end
- game.Players.PlayerAdded:connect(function(p)
- p.CharacterAdded:connect(function(c)
- local t, h = c:WaitForChild'HumanoidRootPart', c:WaitForChild'Humanoid'
- local running = false
- h.StateChanged:connect(function(state)
- if check_enum(state, StartEnums) and not running then
- running = true
- local start, EndLoop, pos = tick(), false, t.Position
- local died
- died = h.Died:Connect(function()
- EndLoop = true
- died:Disconnect()
- end)
- --print('start', h:GetState())
- while wait(.1) do
- local Lstate = h:GetState()
- if tick()-start > .5 then
- if t.Position.Y-pos.Y > 25 then
- --print('Jump hieght: ',t.Position.Y-pos.Y)
- if Kick then
- p:Kick'Exploiting is not tolerated.'
- EndLoop = true
- else
- t.CFrame = CFrame.new(pos-Vector3.new(0,2,0))
- wait()
- Anchored(true, t)
- wait(5)
- Anchored(false, t)
- EndLoop = true
- end
- end
- end
- if check_enum(Lstate, EndEnums) or EndLoop then
- --print('LoopEnd', ' ~~ Air time: ', tick()-start)
- running = false
- died:Disconnect()
- break
- end
- end
- end
- end)
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement