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

How to make if not enough and true visible? [closed]

Asked by 4 years ago
Edited 4 years ago
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function(click)
    if player.leaderstats.Money.Value >= 3000 then
        player.leaderstats.Money.Value = player.leaderstats.Money.Value - 3000

        game.ReplicatedStorage.Tools.MegaGravityCoil:Clone().Parent = player:WaitForChild("Backpack")
    elseif player.leaderstats.Money.Value <= 3000 then
        game.StarterGui.ScreenGui.NotEnough.Visible = true
    end
end)

Closed as Non-Descriptive by imKirda, Spjureeedd, IAmNotTheReal_MePipe, and killerbrenden

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Contents of StarterGui are automatically replicated to the PlayerGui, so you would reference your frame there instead. Also, I don't entirely understand your question. Wdym 'if not enough visible'?

local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

script.Parent.MouseButton1Click:Connect(function(click)
    if player.leaderstats.Money.Value >= 3000 then
        player.leaderstats.Money.Value = player.leaderstats.Money.Value - 3000

        game.ReplicatedStorage.Tools.MegaGravityCoil:Clone().Parent = player:WaitForChild("Backpack")
    elseif player.leaderstats.Money.Value <= 3000 then
        playerGui.ScreenGui.NotEnough.Visible = true
    end
end)
0
thanks its working Green_SteveYT 8 — 4y
0
no problem :) Xx_FROSTBITExX 116 — 4y
Ad