Jump to content

رقم


TrmPlmn

Recommended Posts

  • Scripting Moderators
Posted (edited)

على حسب الطريقة يلي تبيه يتغير فيها

مثلا تبيه كل وقت  معين

إستخدم
setTimer
ذا بيخليك تشغل فنكشن وتخليه يتكرر كل وقت معين


بالنسبة للزيادة والنقصان

تحتاج متغيرين متغير فيه القيمة يلي تنقصها وتزودها

ومتغير ثاني عشان تعرف هل هي زيادة أو نقصان

مثال بسيط

local progress = 0
local progressState = true -- ترو زيادة مثلا فولس نقصان

function change()
  progress = progressState and progress+1 or progress-1
  if progress >= 100 or progress <= 0 then --نتحقق هل وصل 100 وفوق؟ او 0 وتحت؟
	progressState = not progressState -- نسوي تبديل للمتغير
  end
end
	 

 

Edited by xLive
Posted

جربت اعوض بالمتغير للقيمة اللي مطلوب تتغير

ولا ضبط

ممكن مثال على نص او صوره ؟

Posted
addEventHandler("onClientRender", root, function()
local num = math.ceil(interpolateBetween(0,0,0,100,0,0,(getTickCount()-0)/50000, "CosineCurve"))
dxDrawText(num,50,400,50,50, tocolor(241, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false)
end)

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...