В этом видео гайде я расскажу вам как сделать веселую кнопку.
1 вариант кода:
Код
local Monitor = select(GetCurrentResolution(), GetScreenResolutions()) local MonitorQ = string.match(Monitor, "%d+x(%d+)") local MonitorW = string.match(Monitor, "(%d+)x%d+")
function Smail_Button_Ran() local RandomCorrd1 = random(1,MonitorQ/3) local RandomCorrd2 = random(1,MonitorW/3) local RandomScale1 = random(50, 150) local RandomScale2 = random(50, 150) SMAIL_Buttons:SetWidth(RandomScale1) SMAIL_Buttons:SetHeight(RandomScale2) SMAIL_Buttons:SetPoint("CENTER", RandomCorrd1,RandomCorrd2) end
function Smail_Button_Win() print("Вы убили кнопку! Гратц вас!") SMAIL_Buttons:SetPoint("CENTER",0,0) SMAIL_Buttons:SetWidth(100) SMAIL_Buttons:SetHeight(50) end
function Smail_Button_Ran() local RandomCorrd1 = random(1,GetScreenWidth()/3) local RandomCorrd2 = random(1,GetScreenHeight()/3) local RandomScale1 = random(50, 150) local RandomScale2 = random(50, 150) SMAIL_Buttons:SetWidth(RandomScale1) SMAIL_Buttons:SetHeight(RandomScale2) SMAIL_Buttons:SetPoint("CENTER", RandomCorrd1,RandomCorrd2) end
function Smail_Button_Win() print("Вы убили кнопку! Гратц вас!") SMAIL_Buttons:SetPoint("CENTER",0,0) SMAIL_Buttons:SetWidth(100) SMAIL_Buttons:SetHeight(50) end