#help for fixing a script

1 messages · Page 1 of 1 (latest)

safe mesa
#

can anyone help me get my script working for a tycoon game for free i have the script just some bug fixes please 🥺

safe mesa
#

local tycoonsFolder = workspace:WaitForChild("tycoons")
local claimedTycoons = {}

game.Players.PlayerAdded:Connect(function(player)
local tycoonAssigned = nil

-- Find the first unclaimed tycoon
for _, tycoon in ipairs(tycoonsFolder:GetChildren()) do
    if not claimedTycoons[tycoon] then
        claimedTycoons[tycoon] = player
        tycoonAssigned = tycoon
        break
    end
end

if tycoonAssigned then
    -- Update Sign
    local sign = tycoonAssigned:FindFirstChild("Sign1")
    if sign then
        local part = sign:FindFirstChild("Part")
        if part then
            local gui = part:FindFirstChild("Gui")
            if gui and gui:FindFirstChild("Text") then
                gui.Text.Text = player.Name .. "'s Place"
            end
        end
    end

    -- Set character spawn
    player.CharacterAdded:Connect(function(char)
        local spawnLocation = tycoonAssigned:FindFirstChildWhichIsA("SpawnLocation")
        if spawnLocation then
            char:WaitForChild("HumanoidRootPart").CFrame = spawnLocation.CFrame + Vector3.new(0, 3, 0)
        end
    end)
else
    warn("No available tycoon plot for", player.Name)
end

end)

#

this is the script

#

i want so when i join it assignes me tycoon1 and the sign updates to my name

digital jackal
fiery galleon
last python
#

real