Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ==================== NO FALL DAMAGE ====================
- local noFallDamageEnabled = false
- local fallConnection = nil
- local healthConnection = nil
- local function enableNoFallDamage()
- if fallConnection then return end
- noFallDamageEnabled = true
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- healthConnection = humanoid.HealthChanged:Connect(function(health)
- if health < humanoid.MaxHealth then
- humanoid.Health = humanoid.MaxHealth
- end
- end)
- fallConnection = RunService.Heartbeat:Connect(function()
- if not noFallDamageEnabled then return end
- local char = player.Character
- if not char then return end
- local root = char:FindFirstChild("HumanoidRootPart")
- if not root or humanoid.Health <= 0 then return end
- if root.Velocity.Y < -40 then
- local vel = root.Velocity
- root.Velocity = Vector3.new(vel.X, math.max(vel.Y, -25), vel.Z)
- end
- end)
- end
- local function disableNoFallDamage()
- noFallDamageEnabled = false
- if healthConnection then
- healthConnection:Disconnect()
- healthConnection = nil
- end
- if fallConnection then
- fallConnection:Disconnect()
- fallConnection = nil
- end
- end
- MainTab:CreateToggle({
- Name = "No Fall Damage",
- CurrentValue = false,
- Flag = "NoFallDamage",
- Callback = function(Value)
- if Value then
- enableNoFallDamage()
- else
- disableNoFallDamage()
- end
- end,
- })
Advertisement
Add Comment
Please, Sign In to add comment