Fling beta
Key RequiredUniversal

Fling beta

Universal ScriptImhavk8Imhavk8 4.7K views 123 executesUpdated Dec 16, 2024
0.0/ 5(1 votes)
010% Positive
Lua Script•38 lines (1485 chars)
-- Place this in a LocalScript (e.g., StarterPlayerScripts)
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")

-- Function to fling the player
local function flingPlayer(character)
    local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
    if humanoidRootPart then
        -- Apply a random fling direction
        local forceDirection = Vector3.new(
            math.random(-50, 50),
            math.random(50, 100), -- Ensure upward motion
            math.random(-50, 50)
        )
        humanoidRootPart.Velocity = forceDirection
    end
end

-- Function to handle touch input
local function onTouchInput(input)
    if input.UserInputType == Enum.UserInputType.Touch then
        local touchLocation = input.Position
        local target = workspace:FindPartOnRayWithIgnoreList(
            Ray.new(workspace.CurrentCamera.CFrame.Position, (workspace.CurrentCamera:ScreenPointToRay(touchLocation.X, touchLocation.Y).Direction) * 1000),
            {Players.LocalPlayer.Character}
        )
        
        if target and target.Parent and target.Parent:FindFirstChild("Humanoid") then
            local targetPlayer = Players:GetPlayerFromCharacter(target.Parent)
            if targetPlayer and targetPlayer ~= Players.LocalPlayer then
                flingPlayer(target.Parent)
            end
        end
    end
end

-- Connect touch input to function
UserInputService.InputBegan:Connect(onTouchInput)

Features & Information

Will fling anyone you tap Og code do not take

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts