Universal Script 📌
4.7k Views
152 Executions

Fling beta

Universal Script 📌
Imhavk8
Imhavk8Published 5
2 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Will fling anyone you tap Og code do not take

Updates

  1. Script edited: Create script

View Raw
-- 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)


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Script hub
3.2M
753.1k
Bumped 2 hours ago
Key System

Script hub

Hall of Fame #8

Verified script badgeFlow Hub | 50 Games | Updated

Universal Script 📌
400
1.1k
Bumped 4 hours ago
Key System
Universal Script 📌
7.1k
141.6k
Bumped 5 hours ago
Script hub
45.7k
114.4k
Bumped 7 hours ago
Key System
Script hub
3.5M
448.8k
Bumped 7 hours ago
Key System

Script hub

Hall of Fame #4

Verified script badgeOverflow #1 *OP*

Universal Script 📌
14.9k
71.8k
Bumped 8 hours ago