Universal Script 📌
552 Views
1.2k Executions

Simple ClickFling tool

Universal Script 📌
kilomansk
kilomanskPublished 5
8 months 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

very simple added tool last after respawn

View Raw
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Player = Players.LocalPlayer
local Camera = workspace.CurrentCamera

local TOOL_NAME = "FlingMaster"

local function giveTool()
    -- prevent duplicates
    if Player.Backpack:FindFirstChild(TOOL_NAME) 
    or (Player.Character and Player.Character:FindFirstChild(TOOL_NAME)) then
        return
    end

    local tool = Instance.new("Tool")
    tool.Name = TOOL_NAME
    tool.RequiresHandle = false
    tool.CanBeDropped = false
    tool.Parent = Player.Backpack
end

giveTool()

Player.CharacterAdded:Connect(function()
    task.wait(1) -- wait for backpack to load
    giveTool()
end)

local function isHoldingTool()
    local character = Player.Character
    if not character then return false end
    local tool = character:FindFirstChildOfClass("Tool")
    return tool and tool.Name == TOOL_NAME
end

local function getClosestToMouse()
    local mousePos = Player:GetMouse().Hit.Position
    local closestPlayer
    local closestDistance = math.huge


Comments

1
Log in to join the conversation. Login
GoodScript_76's profile picture
GoodScript_768 months ago

It works really well thx for sharing it

3