Lua Roblox Studio复选框

Lua Roblox Studio复选框,lua,Lua,你好,我正在制作一个roblox gui,我有一个复选框。它一直在工作,直到我做了什么我不确定我做了什么我甚至没有在复选框上工作,但下面是代码 function KILLCB_CheckChanged() if checked == false then checked = true script.Parent.Text = "X" elseif checked == true then checked = false script.Parent.Text = "

你好,我正在制作一个roblox gui,我有一个复选框。它一直在工作,直到我做了什么我不确定我做了什么我甚至没有在复选框上工作,但下面是代码


function KILLCB_CheckChanged()
if checked == false then
checked = true
script.Parent.Text = "X"
elseif checked == true then
checked = false
script.Parent.Text = ""
end
end

script.Parent.MouseButton1Down:connect(KILLCB_CheckChanged)

while true do
script.Parent.lblText.BackgroundColor3 = script.Parent.Parent.BackgroundColor3
wait(1)
end

在提供的代码中,
checked
为零,因此
CheckChanged
将不起任何作用。因此,您的复选框不起作用