Universal Script 📌
2.2k Views
295 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
Universal Script 📌
6.9k
13.3k
Bumped 11 minutes ago
Universal Script 📌
125.8k
929.4k
Bumped 41 minutes ago
Script hub
200.9k
2.3M
Bumped 4 hours ago
Key System

Script hub

#21 this week

Verified script badgeAirflow HUB

Script hub
3.7M
907.2k
Bumped 6 hours ago
Key System

Script hub

Hall of Fame #6

Verified script badgeFlow Hub | 73 Games | Updated

Universal Script 📌
52
30
Approved 7 hours ago
Paid