Universal Script πŸ“Œ
1.5k Views
0 Executions

Part Counter OPEN SOURCE

Universal Script πŸ“Œ
zivoria
zivoriaPublished 10
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

This could probably be made a lot better and more optimized but i put near to no effort into this, if you use it please credit me. There isnt many games where this would be useful. Sorry for being inactive. All this does is give you a tool that lets you click on parts and it will add them to a counter at the top of your screen and the selected parts will have a green highlight, click on them again to remove them from the counter.

View Raw
local player = game.Players.LocalPlayer
local backpack = player:WaitForChild("Backpack")
local playerGui = player:WaitForChild("PlayerGui")

for _, item in ipairs(backpack:GetChildren()) do
	if item:IsA("Tool") and item.Name == "Part Selector" then
		item:Destroy()
	end
end

for _, part in ipairs(workspace:GetDescendants()) do
	local highlight = part:FindFirstChild("PartHighlight")
	if highlight then
		highlight:Destroy()
	end
end

local tool = Instance.new("Tool")
tool.Name = "Part Selector"
tool.RequiresHandle = false
tool.Parent = backpack

local screenGui = playerGui:FindFirstChild("PartCounterGUI") or Instance.new("ScreenGui", playerGui)
screenGui.Name = "PartCounterGUI"
screenGui:ClearAllChildren()

local counterLabel = Instance.new("TextLabel", screenGui)
counterLabel.Size = UDim2.new(0, 200, 0, 50)
counterLabel.Position = UDim2.new(0.5, -100, 0, 20)
counterLabel.BackgroundTransparency = 1
counterLabel.TextScaled = true
counterLabel.TextColor3 = Color3.new(1, 1, 1)
counterLabel.Font = Enum.Font.SourceSansBold
counterLabel.Text = "Parts Selected: 0"

local clearButton = Instance.new("TextButton", screenGui)
clearButton.Size = UDim2.new(0, 120, 0, 40)
clearButton.Position = UDim2.new(0.5, -60, 0, 80)
clearButton.BackgroundColor3 = Color3.new(0.3, 0.3, 0.3)
clearButton.TextColor3 = Color3.new(1, 1, 1)


Comments

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

Tags

More universal scripts

See all
Universal Script πŸ“Œ
10.3k
282
Bumped 1 hour ago
High QualityΒ Offering
Universal Script πŸ“Œ
8.4k
32.8k
Bumped 2 hours ago
Key System
Universal Script πŸ“Œ
1.4k
5.9k
Bumped 2 hours ago
Script hub
22.0k
4.3k
Bumped 3 hours ago
Key System
Paid
High QualityΒ Offering
Universal Script πŸ“Œ
1.1k
2.2k
Bumped 3 hours ago
Universal Script πŸ“Œ
1.6k
6.0k
Bumped 3 hours ago
Script hub
164.7k
567.4k
Bumped 7 hours ago
Key System

Script hub

Hall of Fame #6

Verified script badgeAcro Hub OP SCRIPT