Hi Everyone
How To Make The Boolean Button Where I Press The Button, It False, And I Press
Again, It True
Here Is My Code:
local Button = script.Parent
local Bool = script.Boolean
local Numeric = script.Numeric
Button.MouseButton1Click:Connect(function()
-- And I Stuck At Mouse Clicking
end)
Values:
Numeric
The Value That Will Control The Bool Values
If 1 = true
If 0 = false
Boolean
The Value That Displaying A Text
If false = “False”
If true = “True”
And I Stuck At Player Clicking The Button
Sorry If The Topic Are Confusing To Read, Because Im Indonesia
Sorry, I Don’t Show Entire Code, Because I Stuck At Player Press
local Button = script.Parent
local Bool = script.Boolean
local Numeric = script.Numeric
-- Make False to True
Button.MouseButton1Click:Connect(function()
if false == false then
false = true
end
end)
-- Make False back to False
Button.MouseButton1Click:Connect(function()
if false == true then
false = false
end
end)
I Using Numeric To Control The Boolean
If 1 = True
If 0 = False
code is too long, you can use if else loops
Button.MouseButton1Click:Connect(function()
if false == false then
false = true
else
false = false
end
end)
local Button = script.Parent
local Bool = script.Boolean
local Numeric = script.Numeric
Button.MouseButton1Click:Connect(function()
if Numeric.Value == 1 then
Bool.Value = true
elseif Numeric.Value == 0 then
Bool.Value = false
end
end)
Indonesia Lang: Itu pakai aja kode diatas, kalau salah di koreksi soalnya aku gatau kamu pakai properti value atau bukan
English Lang: Just use the code above, if it’s wrong, correct it because I don’t know if you use property values or not
Can you clarify what you’re trying to do?
terima kasih untuk codenya
tapi hal tersebut sudah terjawab sama @HeyWhatsHisFace
edit: Dihapus lagi, dahlah, mungkin code kamu akan disolusikan
1 Like
Haha, yaudah sama sama [character]