Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My Selection frame not visible when selecting your tower, after looking at another player's tower?

Asked by 2 years ago
local function toggleTowerInfo()
    workspace.Camera:ClearAllChildren()
    gui.Towers.Title.Text = placedTowers.. "/" ..maxTowers

    if selectedTower then
        CreateRangeCircle(selectedTower)
        gui.Selection.Visible = true
        local config = selectedTower.Config
        gui.Selection.Stats.Damage.Value.Text = config.Damage.Value
        gui.Selection.Stats.Range.Value.Text = config.Range.Value
        gui.Selection.Stats.Cooldown.Value.Text = config.Cooldown.Value
        gui.Selection.Title.TowerName.Text = selectedTower.Name
        gui.Selection.Title.TowerImage.Image = config.Image.Texture
        gui.Selection.Title.OwnerName.Text = "Owner: "..config.Owner.Value

        if config.Owner.Value == Players.LocalPlayer.Name then
            gui.Selection.Action.Sell.Visible = true

            local upgradeTower = config:FindFirstChild("Upgrade")
            if upgradeTower then
                gui.Selection.Action.Upgrade.Visible = true
                gui.Selection.Action.Upgrade.Price.Text = "UPGRADE: " ..upgradeTower.Value.Config.Price.Value.."$"
            else
                gui.Selection.Action.Upgrade.Visible = false
            end
        else
            gui.Selection.Action.Visible = false
        end
    else
        gui.Selection.Visible = false
    end
end

I think the title explains everything...Once I go into a local server in test with two players, Once I look at another player's tower, and then select MY tower, the Selection frame doesn't turn visible again.

Answer this question