Mr.Mostafa

آستفسآر عن Table + math.random

Recommended Posts

سلام عليكم

آبي لو آلآعب كتب كومآند يختآر عشوآئي من آلجدول فلوس ولآ نقآط

لو فلوس يعطيه آو آختآر عشوآئي نقآط يعطيه نقآط

محآولتي :

ملحوظة : givePlayerPoint للمثآل فقط مب آكتر

Prizes = {

        [1] = {"Points"},

        [2] = {"Money"},

}

addCommandHandler("giveme",
	function (	)
	local randomNum = math.random(1,100)
		for i,v in ipairs(math.random(Prizes)) do
			if v == "Points" then
				givePlayerPoint(source, randomNum)
					outputChatBox("نقآط "..randomNum.." لقد حصلت علي",source,255,0,0,true)
			end
			if v == "Money" then
				givePlayerMoney(source, randomNum)
					outputChatBox("فلوس "..randomNum.." لقد حصلت علي",source,255,0,0,true)
			end
		end
	end
)

 

Share this post


Link to post
Prizes = { "Points","Money" }

addCommandHandler("giveme",
	function ( source )
	local randomNum = math.random(1,100)
		local vPrizes = Prizes[ math.random ( #Prizes ) ]
			if vPrizes == "Points" then
				givePlayerPoint(source, randomNum)
					outputChatBox("نقآط "..randomNum.." لقد حصلت علي",source,255,0,0,true)
			elseif vPrizes == "Money" then
				givePlayerMoney(source, randomNum)
					outputChatBox("فلوس "..randomNum.." لقد حصلت علي",source,255,0,0,true)
			end
	end
)

جرب

Share this post


Link to post
13 minutes ago, MARIY said:

Prizes = { "Points","Money" }

addCommandHandler("giveme",
	function ( source )
	local randomNum = math.random(1,100)
		local vPrizes = Prizes[ math.random ( #Prizes ) ]
			if vPrizes == "Points" then
				givePlayerPoint(source, randomNum)
					outputChatBox("نقآط "..randomNum.." لقد حصلت علي",source,255,0,0,true)
			elseif vPrizes == "Money" then
				givePlayerMoney(source, randomNum)
					outputChatBox("فلوس "..randomNum.." لقد حصلت علي",source,255,0,0,true)
			end
	end
)

جرب

آشتغل تسلم :)

  • Like 1

Share this post


Link to post
Just now, MARIY said:

Prizes = { "Points","Money" }

addCommandHandler("giveme",
	function ( source )
	local randomNum = math.random(1,100)
		local vPrizes = Prizes[ math.random ( #Prizes ) ]
			if vPrizes == "Points" then
				givePlayerPoint(source, randomNum)
					outputChatBox("نقآط "..randomNum.." لقد حصلت علي",source,255,0,0,true)
			elseif vPrizes == "Money" then
				givePlayerMoney(source, randomNum)
					outputChatBox("فلوس "..randomNum.." لقد حصلت علي",source,255,0,0,true)
			end
	end
)

جرب

 

Edited by Berko
--

Share this post


Link to post

النقاط ما اعتقد بتتحفظ ؟

+ ما بتزيد بشكل صحيح

كدة لو مثلا نقاطك 50

والجائزة 100

بيكون 100 ومب 150

Edited by MrKAREEM

Share this post


Link to post
52 minutes ago, MrKAREEM said:

النقاط ما اعتقد بتتحفظ ؟

+ ما بتزيد بشكل صحيح

كدة لو مثلا نقاطك 50

والجائزة 100

بيكون 100 ومب 150

حيآك آلله + 

On ٦‏/٨‏/٢٠١٨ at 14:33, Mr.Mostafa said:

ملحوظة : givePlayerPoint للمثآل فقط مب آكتر

 

Share this post


Link to post

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.