Jump to content

a litte help in onClientRender


Oussema

Recommended Posts

Posted

i want from the number change from 1 to 10,  from 10 to 1 

local selected = 1 



addEventHandler("onClientRender",root,function()
    
    
    
    outputDebugString(selected)
    end)

 

i didn't understand how to do with this event , anyone know ? 

 

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
5 minutes ago, Oussema said:

i want from the number change from 1 to 10,  from 10 to 1 


local selected = 1 



addEventHandler("onClientRender",root,function()
    
    
    
    outputDebugString(selected)
    end)

 

i didn't understand how to do with this event , anyone know ? 

 

i am really didn't understand what do you want to say  but try this

local selected = 1
local num=1
addEventHandler("onClientRender",root,function()
    if selected>=10 then
      num=-1
      end
    if selected<=0 then
      num=1
      end
        selected=selected+num
    outputDebugString(selected)
    end)

 

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
9 minutes ago, Oussema said:

i want from the number change from 1 to 10,  from 10 to 1 


local selected = 1 



addEventHandler("onClientRender",root,function()
    
    
    
    outputDebugString(selected)
    end)

 

i didn't understand how to do with this event , anyone know ? 

 

If you want a better service ,go to the other languages section and find your language.

because it's hard to understand what you are trying to explain.

 

7YwV3kT.png

ℙℝM∀✗

Video Editor --- Images and pictures Editor.

Trial LUA Scripter. 

Scripting Skills 

     ↧ 

26%

 

Posted
7 hours ago, ProMax said:

If you want a better service ,go to the other languages section and find your language.

because it's hard to understand what you are trying to explain.

already Master_MTA understand me 

 

7 hours ago, Master_MTA said:

i am really didn't understand what do you want to say  but try this


local selected = 1
local num=1
addEventHandler("onClientRender",root,function()
    if selected>=10 then
      num=-1
      end
    if selected<=0 then
      num=1
      end
        selected=selected+num
    outputDebugString(selected)
    end)

 

yep this worked for me like what i want but bro there another :~ now pls ! 

the numbers changes faster as :O , i can make it changes every 5 sec but not by using setTimer i want it with OnClientRender

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
1 hour ago, Oussema said:

already Master_MTA understand me 

 

yep this worked for me like what i want but bro there another :~ now pls ! 

the numbers changes faster as :o , i can make it changes every 5 sec but not by using setTimer i want it with OnClientRender

try this

local selected = 1
local num=1
local master=0
addEventHandler("onClientRender",root,function()
    master=master+1
    if master=1000*5 then
      master=0
    if selected>=10 then
      num=-1
      end
    if selected<=0 then
      num=1
      end
        selected=selected+num
    outputDebugString(selected)
      end
    end)

 

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
44 minutes ago, Master_MTA said:

try this


local selected = 1
local num=1
local master=0
addEventHandler("onClientRender",root,function()
    master=master+1
    if master=1000*5 then
      master=0
    if selected>=10 then
      num=-1
      end
    if selected<=0 then
      num=1
      end
        selected=selected+num
    outputDebugString(selected)
      end
    end)

 

0 errors but not worked 

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
9 minutes ago, Oussema said:

0 errors but not worked 

did you waited for 5 sec?

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted

try this and tell me the result

local selected = 1
local num=1
local master=0
tt=true
addEventHandler("onClientRender",root,function()
    master=master+1
    if tt=true then
      tt=false
      outputChatBox(master)
      end
    if master=1000*5 then
      outputChatBox('done')
      master=0
    if selected>=10 then
      num=-1
      end
    if selected<=0 then
      num=1
      end
        selected=selected+num
    outputDebugString(selected)
      end
    end)

 

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
8 minutes ago, Master_MTA said:

try this and tell me the result


local selected = 1
local num=1
local master=0
tt=true
addEventHandler("onClientRender",root,function()
    master=master+1
    if tt=true then
      tt=false
      outputChatBox(master)
      end
    if master=1000*5 then
      outputChatBox('done')
      master=0
    if selected>=10 then
      num=-1
      end
    if selected<=0 then
      num=1
      end
        selected=selected+num
    outputDebugString(selected)
      end
    end)

 

this showing only number 1 in chatbox 

means , only outputChatBox(master) 

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted (edited)
1 minute ago, Oussema said:

this showing only number 1 in chatbox 

means , only outputChatBox(master) 

local selected = 1
local num=1
addEventHandler("onClientRender",root,function()
    master=master+1
    if master==1000*5 then
      master=0
    if selected>=10 then
      num=-1
      end
    if selected<=0 then
      num=1
      end
        selected=selected+num
    outputDebugString(selected)
      end
    end)

what about somthing like that

Edited by Master_MTA

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
1 minute ago, Master_MTA said:

local selected = 1
local num=1
addEventHandler("onClientRender",root,function()
    master=master+1
    if master=3 then
      master=0
    if selected>=10 then
      num=-1
      end
    if selected<=0 then
      num=1
      end
        selected=selected+num
    outputDebugString(selected)
      end
    end)

what about somthing like that

this outputing the numbers fine , but faster asf , 

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
Just now, Oussema said:

this outputing the numbers fine , but faster asf , 

i edit it try  it

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
Just now, Oussema said:

nothing draws ,0 errors 

show me your code with draw functions 

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
18 minutes ago, Oussema said:

it's just outputDebug bro not a dxdraw or somthing else

bro bro thank you very much <3 i think i got it 

any time +_+

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted

btw, just to keep in mind that onClientRender runs 50~60 frames per second , as i guess , that means a = 0 , if a = a + 1 on a rendered function it add +1 to a 50~60 time per second

and what the hell is this ? 

    if master=3 then
xdd it needs ==
  • Like 1

IT Projet Manager

 

Posted
10 hours ago, coNolel said:

btw, just to keep in mind that onClientRender runs 50~60 frames per second , as i guess , that means a = 0 , if a = a + 1 on a rendered function it add +1 to a 50~60 time per second

and what the hell is this ? 


    if master=3 then
xdd it needs ==

ye ye i got it xD 

about master=3  ,np i know it so np if write faster and forget that 2nd = hhhhhhhhhhhhh 

anyway i got what i want guys thx everyone <3 

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
local selected = 0
local num=1
local tick = getTickCount(  )
addEventHandler("onClientRender",root,function()
	if getTickCount(  )-tick >= 5000 then -- 5000 = 5 seconds
		if selected>=10 then num=-1 end
		if selected<=0 then num=1 end
		tick = getTickCount(  )
	    selected=selected+num
		outputDebugString(selected)
	end
end)

Works with all frame rates.

Posted (edited)
local num = 0
local tick = getTickCount()

addEventHandler("onClientRender", getRootElement(), function ()
	if tick+5000 <= getTickCount() then
		if num >= 10 then 
			num = 0
		end
		tick = getTickCount()
		num = num + 1
		outputDebugString(num)
	end
end)
local num = 0
local negative = false
local tick = getTickCount()

addEventHandler("onClientRender", getRootElement(), function ()
	if tick+5000 <= getTickCount() then
		if num >= 10 then 
			negative = true
		elseif num <= 1 then 
			negative = false
		end
		tick = getTickCount()
		if not negative then
			num = num + 1
		else
			num = num - 1 
		end
		outputDebugString(num)
	end
end)

 

Edited by kikos500
Posted
4 hours ago, Mr.Loki said:

local selected = 0
local num=1
local tick = getTickCount(  )
addEventHandler("onClientRender",root,function()
	if getTickCount(  )-tick >= 5000 then -- 5000 = 5 seconds
		if selected>=10 then num=-1 end
		if selected<=0 then num=1 end
		tick = getTickCount(  )
	    selected=selected+num
		outputDebugString(selected)
	end
end)

Works with all frame rates.

i've got what i want ^_^ anyway thx bro <3 

40 minutes ago, kikos500 said:

local num = 0
local tick = getTickCount()

addEventHandler("onClientRender", getRootElement(), function ()
	if tick+5000 <= getTickCount() then
		if num >= 10 then 
			num = 0
		end
		tick = getTickCount()
		num = num + 1
		outputDebugString(num)
	end
end)
local num = 0
local negative = false
local tick = getTickCount()

addEventHandler("onClientRender", getRootElement(), function ()
	if tick+5000 <= getTickCount() then
		if num >= 10 then 
			negative = true
		elseif num <= 1 then 
			negative = false
		end
		tick = getTickCount()
		if not negative then
			num = num + 1
		else
			num = num - 1 
		end
		outputDebugString(num)
	end
end)

 

You too Thx

n-560x95_FFFFFF_FFFFFF_000000_000000.png

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...