calcStart = function() for key,calclabel in pairs(calcLabel) do guiSetVisible(calclabel, true) end guiSetVisible(calcEdit, true) guiSetVisible(calcReset, true) guiSetVisible(calcGetResult, true) end removeLetters = function(element) local txt = guiGetText(element) local removed = string.gsub(txt, "[^0-9/*+^-]", "") if removed ~= txt then guiSetText(element, removed) end end calculate = function() local calc = guiGetText(calcEdit) triggerServerEvent("CITphone.calculate", root, calc) end addEvent("CITphone.calculated", true) addEventHandler("CITphone.calculated", localPlayer, function(ans) guiSetText(calcLabel[8], ans) end ) resetCalcEdit = function() guiSetText(calcEdit, "") guiSetText(calcLabel[8], "") end