Universal Script 📌
2.2k Views
249 Executions

Remove Part Universal KEYLESS

Universal Script 📌
bettusan
bettusanFirst script
1 year 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

Binds f1 - remove f2 - undo f4 - undo all

View Raw
-- f1 - remove
-- f2 - undo
-- f4 - undo all

-- LocalScript in StarterPlayerScripts
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local mouse = player:GetMouse()

-- table of removed objects
local removedStack = {}

-- check: is the object part of a character (does the model have a Humanoid)?
local function isCharacterPart(part)
    if part and part.Parent then
        if part.Parent:FindFirstChildOfClass("Humanoid") then
            return true
        end
    end
    return false
end

-- delete the object under the cursor
local function deletePartUnderCursor()
    local target = mouse.Target
    if target and (target:IsA("Part") or target:IsA("MeshPart") or target:IsA("UnionOperation")) then
        if isCharacterPart(target) then
            warn("You cannot delete character parts!")
            return
        end

        -- save the object and its parent in the stack
        table.insert(removedStack, {
            object = target,
            parent = target.Parent
        })

        target.Parent = nil -- hide the object
        print("Deleted object:", target.Name, "(in stack:", #removedStack .. ")")


Comments

2
Log in to join the conversation. Login
RCDHookify's profile picture
RCDHookify1 year ago

Can other people see?

1
bettusan's profile picture
bettusanUploader1 year ago

@RCDHookify No, this is only for the client.

1

More universal scripts

See all
Script hub
9.6k
70.7k
Bumped 36 minutes ago
Key System
Script hub
186.9k
1.9M
Bumped 2 hours ago
Key System

Script hub

#13 this week

Verified script badgeAirflow HUB

Script hub
602.2k
52.8k
Bumped 2 hours ago
Script hub
45.6k
11.1k
Bumped 4 hours ago
Key System
Paid

Script hub

#25 this month

Verified script badgeZekeHub - 58 Games, 1,300+ Features

Universal Script 📌
53
236
Approved 4 hours ago