-
What do you want to achieve?
I am currently working on a small little project where there are tons of things to do and one of them involves turning off the “artificial air generator 2.0” I decided to make a special currency for doing that
in which you need 2 of that currency to turn off the “artificial air generator 2.0” -
What is the issue?
(Image where I have more than 2)
The issue here is that it always thinks that I have less than 2 Energy Magnets
-
What solutions have you tried so far?
I have tried to switch the places of the options inside the code but that just made the player able to turn off the air generator with 0 energy magnets. I tried looking for some solutions on the developer hub but I couldn’t find any.
local button = script.Parent
local UI = game.ServerStorage.Confirm
button.mouseClick:connect(function(plr)
if plr["Energy Magnets"].Value >= 2 then
UI.Title.Text = "Are you sure you want to spend 2 energy magnets to turn off the air generator?"
elseif plr["Energy Magnets"].Value <= 2 then
UI.Title.Text = "You need 2 energy magnets to turn off the air generator!"
UI.Yes.Visible = false
UI.No.Visible = false
UI.Ok.Visible = true
end
local a = UI:Clone()
a.Parent = plr.PlayerGui.UI
end)
