Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make if not enough and true visible?

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)

1 answer

✓ Accepted answer

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)

2 comments

0

thanks its working

0

no problem :)

This discussion is preserved as it was. New answers, comments, and votes are closed.