Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not game:IsLoaded() then game.Loaded:Wait() end
- function missing(t, f, fallback)
- if type(f) == t then return f end
- return fallback
- end
- cloneref = missing("function", cloneref, function(...) return ... end)
- newcclosure = missing("function", newcclosure, function(f) return f end)
- hookfunction = missing("function", hookfunction)
- hookmetamethod = missing("function", hookmetamethod)
- getnamecallmethod = missing("function", getnamecallmethod or get_namecall_method)
- checkcaller = missing("function", checkcaller, function() return false end)
- getactors = missing("function", getactors, function() return {} end)
- run_on_actor = missing("function", run_on_actor, function() end)
- isfunctionhooked = missing("function", isfunctionhooked, function() return false end)
- restorefunction = missing("function", restorefunction, function() end)
- sethidden = missing("function", sethiddenproperty or set_hidden_property or set_hidden_prop)
- gethidden = missing("function", gethiddenproperty or get_hidden_property or get_hidden_prop)
- setscriptable = missing("function", setscriptable, nil)
- local function SafeSetProperty(instance, property, value)
- pcall(function()
- if sethidden then
- sethidden(instance, property, value)
- elseif setscriptable then
- setscriptable(instance, property, true)
- instance[property] = value
- else
- instance[property] = value
- end
- end)
- end
- task.spawn(function()
- pcall(function()
- if not (hookfunction and hookmetamethod and getnamecallmethod) then return end
- local ProtectedInstances = {}
- local _Instance = Instance.new
- local _tostring = tostring
- local InstanceHook; InstanceHook = hookfunction(_Instance, newcclosure(function(...)
- if checkcaller() then
- local NewInstance = InstanceHook(...)
- if NewInstance then
- NewInstance:SetAttribute("MainVM", true)
- ProtectedInstances[NewInstance] = true
- end
- return NewInstance
- end
- return InstanceHook(...)
- end))
- local tostringHook; tostringHook = hookfunction(_tostring, newcclosure(function(...)
- if not checkcaller() then
- local Arguments = {...}
- if ProtectedInstances[Arguments[1]] then return end
- end
- return tostringHook(...)
- end))
- local FunctionHook; FunctionHook = hookmetamethod(game, "__namecall", newcclosure(function(self, ...)
- local Arguments = {...}
- local Method = getnamecallmethod()
- if not checkcaller() then
- if ProtectedInstances[self] and Method:match("IsA") then return end
- if Method:match("^FindFirst") then
- local Instance = self[Method](self, Arguments[1])
- if Instance and ProtectedInstances[Instance] then return false end
- end
- if Method:match("Attribute") and Arguments[1] == "MainVM" then return false end
- end
- return FunctionHook(self, ...)
- end))
- local PropertiesHook; PropertiesHook = hookmetamethod(game, "__index", newcclosure(function(self, index)
- if index:match("^FindFirst") and not checkcaller() then
- local IndexFunction = self[index]
- if typeof(IndexFunction) == "function" and not isfunctionhooked(IndexFunction) then
- local IndexFunctionHook; IndexFunctionHook = hookfunction(IndexFunction, newcclosure(function(...)
- if not checkcaller() then
- local Arguments = {...}
- restorefunction(IndexFunction)
- local Instance = IndexFunction(self, Arguments[2])
- if Instance and ProtectedInstances[Instance] then return false end
- end
- end))
- end
- end
- if not checkcaller() and ProtectedInstances[self] then return end
- return PropertiesHook(self, index)
- end))
- end)
- end)
- Services = setmetatable({}, {
- __index = function(self, name)
- local success, cache = pcall(function()
- return cloneref(game:GetService(name))
- end)
- if success then
- rawset(self, name, cache)
- return cache
- else
- error("Invalid Service: " .. tostring(name))
- end
- end
- })
- local queue_on_teleport = missing("function", queue_on_teleport or (syn and syn.queue_on_teleport) or (fluxus and fluxus.queue_on_teleport))
- local Players = Services.Players
- local RunService = Services.RunService
- local UserInputService = Services.UserInputService
- local TweenService = Services.TweenService
- local CoreGui = Services.CoreGui
- local LocalPlayer = Players.LocalPlayer
- if getgenv().walkflingisenabled then
- getgenv().walkflingisenabled = false
- task.wait(0.2)
- end
- local function GetGuiParent()
- if get_hidden_gui then return get_hidden_gui() end
- if gethui then return gethui() end
- if CoreGui then return CoreGui end
- return LocalPlayer:WaitForChild("PlayerGui")
- end
- local OldGui = GetGuiParent():FindFirstChild("UniversalWalkFling")
- if OldGui then OldGui:Destroy() end
- getgenv().walkflingisenabled = false
- local CurrentStrength = 10000 --defailt: 10000
- local NoclipConnection = nil
- local DiedConnection = nil
- local ScreenGui = Instance.new("ScreenGui")
- local MainFrame = Instance.new("Frame")
- local TitleLabel = Instance.new("TextLabel")
- local CloseButton = Instance.new("TextButton")
- local ToggleButton = Instance.new("TextButton")
- local InputBox = Instance.new("TextBox")
- ScreenGui.Name = "UniversalWalkFling"
- ScreenGui.Parent = GetGuiParent()
- ScreenGui.ResetOnSpawn = false
- ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- MainFrame.Name = "MainFrame"
- MainFrame.Parent = ScreenGui
- MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
- MainFrame.BorderSizePixel = 0
- MainFrame.Position = UDim2.new(0.5, -110, 0.5, -80)
- MainFrame.Size = UDim2.new(0, 220, 0, 160)
- MainFrame.Active = true
- TitleLabel.Name = "TitleLabel"
- TitleLabel.Parent = MainFrame
- TitleLabel.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
- TitleLabel.Size = UDim2.new(1, -30, 0, 30)
- TitleLabel.Font = Enum.Font.GothamBold
- TitleLabel.Text = "WalkFling Panel"
- TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- TitleLabel.TextSize = 14
- CloseButton.Name = "CloseButton"
- CloseButton.Parent = MainFrame
- CloseButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
- CloseButton.BorderSizePixel = 0
- CloseButton.Position = UDim2.new(1, -30, 0, 0)
- CloseButton.Size = UDim2.new(0, 30, 0, 30)
- CloseButton.Font = Enum.Font.GothamBold
- CloseButton.Text = "X"
- CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- CloseButton.TextSize = 14
- InputBox.Name = "InputBox"
- InputBox.Parent = MainFrame
- InputBox.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
- InputBox.BorderSizePixel = 0
- InputBox.Position = UDim2.new(0.1, 0, 0.3, 0)
- InputBox.Size = UDim2.new(0.8, 0, 0, 35)
- InputBox.Font = Enum.Font.Gotham
- InputBox.PlaceholderText = "Enter Strength Number"
- InputBox.Text = tostring(CurrentStrength)
- InputBox.TextColor3 = Color3.fromRGB(255, 255, 255)
- InputBox.TextSize = 12
- InputBox.ClearTextOnFocus = false
- ToggleButton.Name = "ToggleButton"
- ToggleButton.Parent = MainFrame
- ToggleButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- ToggleButton.BorderSizePixel = 0
- ToggleButton.Position = UDim2.new(0.1, 0, 0.65, 0)
- ToggleButton.Size = UDim2.new(0.8, 0, 0, 35)
- ToggleButton.Font = Enum.Font.GothamSemibold
- ToggleButton.Text = "Enable"
- ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- ToggleButton.TextSize = 14
- local function dragGUI(gui)
- task.spawn(function()
- local dragging
- local dragInput
- local dragStart = Vector3.new(0,0,0)
- local startPos
- local function update(input)
- local delta = input.Position - dragStart
- local Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- TweenService:Create(gui, TweenInfo.new(.20), {Position = Position}):Play()
- end
- gui.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = gui.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- gui.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- update(input)
- end
- end)
- end)
- end
- dragGUI(MainFrame)
- local function ParseStrength(text)
- if typeof(text) ~= "string" then return 10000 end
- if text == "" then return 10000 end
- local low = text:lower()
- if low:find("inf") or low:find("huge") then return math.huge end
- if low:find("random") then return math.random(10000, 1000000) end
- if low:find("nan") then return 0/0 end
- return tonumber(text) or CurrentStrength
- end
- local function GetRoot(char)
- return char:FindFirstChild("HumanoidRootPart") or char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
- end
- local function ModifyPhysics(char, density)
- if not char then return end
- pcall(function()
- for _, v in pairs(char:GetDescendants()) do
- if v:IsA("BasePart") then
- SafeSetProperty(v, "CustomPhysicalProperties", PhysicalProperties.new(density, 0.3, 0.5))
- end
- end
- end)
- end
- local function BreakVelocity()
- local char = LocalPlayer.Character
- if not char then return end
- local Stop = false
- task.delay(1, function() Stop = true end)
- task.spawn(function()
- while not Stop do
- for _, v in pairs(char:GetDescendants()) do
- if v:IsA("BasePart") then
- v.Velocity = Vector3.new(0, 0, 0)
- v.RotVelocity = Vector3.new(0, 0, 0)
- end
- end
- task.wait()
- end
- end)
- end
- InputBox:GetPropertyChangedSignal("Text"):Connect(function()
- CurrentStrength = ParseStrength(InputBox.Text)
- end)
- local StopLoop
- StopLoop = newcclosure(function()
- getgenv().walkflingisenabled = false
- ToggleButton.Text = "Enable"
- ToggleButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- if NoclipConnection then NoclipConnection:Disconnect() NoclipConnection = nil end
- if DiedConnection then DiedConnection:Disconnect() DiedConnection = nil end
- pcall(function()
- local char = LocalPlayer.Character
- if char then
- BreakVelocity()
- ModifyPhysics(char, 0.7)
- end
- end)
- end)
- local StartLoop = newcclosure(function()
- if getgenv().walkflingisenabled then return end
- local char = LocalPlayer.Character
- if not char then return end
- local hum = char:FindFirstChildWhichIsA("Humanoid")
- if not hum then return end
- getgenv().walkflingisenabled = true
- if DiedConnection then DiedConnection:Disconnect() end
- DiedConnection = hum.Died:Connect(StopLoop)
- CurrentStrength = ParseStrength(InputBox.Text)
- ToggleButton.Text = "Enabled"
- ToggleButton.BackgroundColor3 = Color3.fromRGB(50, 180, 50)
- ModifyPhysics(char, 100)
- local movel = 0.1
- NoclipConnection = RunService.Stepped:Connect(function()
- if not getgenv().walkflingisenabled then return end
- pcall(function()
- local c = LocalPlayer.Character
- if c then
- for _, v in pairs(c:GetDescendants()) do
- if v:IsA("BasePart") and v.CanCollide then v.CanCollide = false end
- end
- end
- end)
- end)
- task.spawn(function()
- while getgenv().walkflingisenabled do
- local success, err = pcall(function()
- RunService.Heartbeat:Wait()
- local c = LocalPlayer.Character
- local root = c and GetRoot(c)
- while not (c and c.Parent and root and root.Parent) and getgenv().walkflingisenabled do
- RunService.Heartbeat:Wait()
- c = LocalPlayer.Character
- root = c and GetRoot(c)
- end
- if not getgenv().walkflingisenabled then return end
- local vel = root.Velocity
- root.Velocity = vel * CurrentStrength + Vector3.new(0, CurrentStrength, 0)
- RunService.RenderStepped:Wait()
- if not getgenv().walkflingisenabled then return end
- if c and c.Parent and root and root.Parent then
- root.Velocity = vel
- end
- RunService.Stepped:Wait()
- if not getgenv().walkflingisenabled then return end
- if c and c.Parent and root and root.Parent then
- root.Velocity = vel + Vector3.new(0, movel, 0)
- movel = movel * -1
- end
- end)
- if not success and getgenv().walkflingisenabled then
- print("Loop Error: " .. tostring(err))
- end
- end
- end)
- end)
- ToggleButton.MouseButton1Click:Connect(newcclosure(function()
- if getgenv().walkflingisenabled then
- StopLoop()
- else
- StartLoop()
- end
- end))
- CloseButton.MouseButton1Click:Connect(newcclosure(function()
- StopLoop()
- ScreenGui:Destroy()
- end))
- if queue_on_teleport then
- LocalPlayer.OnTeleport:Connect(function(State)
- queue_on_teleport("loadstring(game:HttpGet('https://pastebin.com/raw/rEb9BcVi'))()")
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment