Universal Script 📌
4.5k Views
5.7k Executions

Lumber tycoon 2 wood counter

Universal Script 📌
Chevy_k20
Chevy_k2010K executions
6 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

Counts wood

View Raw
local player = game:GetService("Players").LocalPlayer
local runService = game:GetService("RunService")

-- Create UI
local screenGui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
screenGui.Name = "WoodTypeCounter"

local frame = Instance.new("Frame", screenGui)
frame.Size = UDim2.new(0, 220, 0, 300)
frame.Position = UDim2.new(0, 10, 0.4, 0)
frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
frame.BackgroundTransparency = 0.3

local label = Instance.new("TextLabel", frame)
label.Size = UDim2.new(1, -10, 1, -10)
label.Position = UDim2.new(0, 5, 0, 5)
label.BackgroundTransparency = 1
label.TextColor3 = Color3.fromRGB(255, 255, 255)
label.TextSize = 14
label.Font = Enum.Font.Code
label.TextXAlignment = Enum.TextXAlignment.Left
label.TextYAlignment = Enum.TextYAlignment.Top
label.TextWrapped = true

local function getWoodData()
    local woodCounts = {}
    
    for _, item in ipairs(workspace:GetDescendants()) do
        -- LT2 identifies wood parts as "WoodSection"
        if item.Name == "WoodSection" and item:IsA("BasePart") then
            -- Check ownership (LT2 uses Owner attribute or Owner value)
            local ownerValue = item:FindFirstChild("Owner") or item.Parent:FindFirstChild("Owner")
            
            if ownerValue and ownerValue.Value == player then
                -- Get wood type from TreeClass attribute/value
                local treeClass = item:FindFirstChild("TreeClass") or item.Parent:FindFirstChild("TreeClass")
                local woodType = treeClass and treeClass.Value or "Unknown"
                
                woodCounts[woodType] = (woodCounts[woodType] or 0) + 1
            end


Comments

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