وظيفة toboolean
تحول لك ال
boolean ل string
function tobool(string)
if type ( string ) == 'string' then
if string == 'true' then
return true
elseif string == 'True' then
return true
elseif string == 'false' then
return false
elseif string == 'False' then
return false
else
return nil
end
end
end
مثال
function HideChat()
button = guiCreateButton(50, 50, 30, 100, "false", false)--عمل زر
local mytext = guiGetText(button) -- احضار النصص المكتوب علي الزر اللي هو فالس
showChat(tobool(mytext)) -- وضع الشات علي حسب الحالة المكتوبة علي الزر اللي فالس يعني يخفيه
end