[لوا] اسكربتات

Commandoskil

Retired AR Staff
مرحبا انا أتمنى ان تتعلموا من هذا الموضوع

1- تغير اسم الغرفه(الماب) و اسم الشامان
tfm.exec.setUIMapName("The name of the map")
tfm.exec.setUIShamanName("The name of the Shaman")
• Replace the red text with the texts you want
2-ثلج
Code:
tfm.exec.snow()

local loopCount = 0
function eventLoop()
if loopCount == 0 then
tfm.exec.snow()
tfm.exec.snow()
end
loopCount = (loopCount + 1) % 100
end
3-الطيران من مسطره
Code:
function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,32,true,true)
end

for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

function eventKeyboard(name,key,down,x,y)
if key==32 then
tfm.exec.movePlayer(name,0,0,true,0,-50,false)
end
end

4- صنع فرق
Code:
red={}
blue={}
function makeTeams()
local playerList={}
for name,player in pairs(tfm.get.room.playerList) do
table.insert(playerList,name)
end
for i=1,#playerList,1 do
local index=math.random(#playerList)
local name=playerList[index]
if i%2==0 then
table.insert(red,name)
else
table.insert(blue,name)
end
table.remove(playerList,index)
end
end
5- اختيار شخص تالقائى ك مصاص دماء
Code:
players = {}
for name,player in pairs(tfm.get.room.playerList) do
table.insert(players,name)
end
tfm.exec.setVampirePlayer(players[math.random(#players)])
[/spoiler]
6-جعل كل الاعبين مصاصين دماء
[spoiler]

for name,player in pairs(tfm.get.room.playerList) do
tfm.exec.setVampirePlayer(name)
end
7- جعل الاعبين الميتين يرجعوا للعب
Code:
function eventPlayerDied(name)
tfm.exec.respawnPlayer(name)
end
[/spoiler]
8- وضع رساله مميزه في الغرفه
[spoiler]
function eventEmotePlayed(player, emote)
if emote == 3 then
ui.addTextArea(0, player .. " is inlove! *-*")
end
end
9 - عندما بالمس الفأر الشامان يحصل على الجبن
Code:
function eventNewGame()
shaman=nil
for name,player in pairs(tfm.get.room.playerList) do
if(tfm.get.room.playerList[name].isShaman) then
shaman=name
print(shaman.." just stole the cheese! CATCH HER!")
tfm.exec.giveCheese(shaman)
end
end
if(shaman==nil) then
print('No shaman found!')
end
end

function eventLoop(ct,cr)
if(shaman~=nil) and not tfm.get.room.playerList[shaman].isDead then
local shamanx=tfm.get.room.playerList[shaman].x
local shamany=tfm.get.room.playerList[shaman].y
for name,player in pairs(tfm.get.room.playerList) do
if not tfm.get.room.playerList[name].isShaman then
x=tfm.get.room.playerList[name].x
y=tfm.get.room.playerList[name].y
if x>shamanx-30 and x<shamanx+30 and y>shamany-30 and y<shamany+30 then
tfm.exec.giveCheese(name)
end
end
end
end
end
10- عند استخدام !قتل يموت الاعب
Code:
function eventChatCommand(p,cm)
if cm == [[قتل]] then
tfm.exec.killPlayer(p)
end
end
11 - التنقل بالضغت
Code:
players = {}

function pythag(x1,y1,x2,y2,r)
local x=x2-x1
local y=y2-y1
local r=r+r
return x*x+y*y<r*r
end

function eventNewPlayer(name)
players[name] = {
spawned = true,
}
system.bindMouse(name, true)
end

function eventMouse(playerName, x, y)
if players[playerName].spawned then
for name, player in pairs(tfm.get.room.playerList) do
if pythag(x, y, player.x, player.y, 25) and playerName ~= name then
local playerData = tfm.get.room.playerList[playerName]
tfm.exec.movePlayer(name, playerData.x, playerData.y)
tfm.exec.displayParticle(36,playerData.x,playerData.y,0,0,0,0,nil)
tfm.exec.displayParticle(36,player.x,player.y,0,0,0,0,nil)
tfm.exec.movePlayer(playerName, player.x, player.y)
end
end
end
end

for k,v in pairs({}) do
tfm.exec["disable"..v](true)
end

for name, player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
12 - مخزن صغير يظهر على الخريطه
Code:
Gizleplayers={} notices={notice=""}

ui.addTextArea(10,"<p align='center'><font face='arial'><a href='event:open'><j><b>Magazin</a></font></p>",name,300,28,50,18,0x00001,0xEB1D51,0.9,true)

function eventTextAreaCallback(id, name, callback)

ui.addTextArea(0,"<p align='center'><a href='event:Invie'>Invie</a></p>",name,270,57,50,20,0x00001,0xCB546B,0.9,true)
ui.addTextArea(1,"<p align='center'><a href='event:Branza'>Branza</a></p>",name,328,57,50,20,0x00001,0xCB546B,0.9,true)
ui.addTextArea(2,"<p align='center'><a href='event:Vampir'>Vampir</a></p>",name,270,87,50,20,0x00001,0xCB546B,0.9,true)
ui.addTextArea(3,"<p align='center'><a href='event:Şaman'>Şaman</a></p>",name,328,87,50,20,0x0001,0xCB546B,0.9,true)
ui.addTextArea(4,"<p align='center'><a href='event:Rosu'>Rosu</a></p>",name,270,117,50,20,0x0001,0xCB546B,0.9,true)
ui.addTextArea(5,"<p align='center'><a href='event:Gaura'>Gaura</a></p>",name, 328,117,50,20,0x0001,0xCB546B,0.9,true)
ui.addTextArea(6,"<p align='center'><a href='event:Verde'>Verde</a></p>",name, 386,117,50,20,0x0001,0xCB546B,0.9,true)
ui.addTextArea(7,"<p align='center'><a href='event:Zapada'>Zapada</a></p>",name,270,147,50,20,0x00001,0xCB546B,0.9,true)
ui.addTextArea(8,"<p align='center'><a href='event:Mort'>Mort</a></p>",name,328,147,50,20,0x00001,0xCB546B,0.9,true)
ui.addTextArea(9,"<p align='center'><a href='event:Blue'>Blue</a></p>",name,386,147,50,20,0x00001,0xCB546B,0.9,true)
ui.addTextArea(10,"<p align='center'><a href='event:Meep'>Meep</a></p>",name,385,57,50,20,0x00001,0xCB546B,0.9,true)
ui.addTextArea(11,"<p align='center'><a href='event:+10'>+10</a></p>",name,385,87,50,20,0x00001,0xCB546B,0.9,true)

if callback=="Invie" then
tfm.exec.respawnPlayer(name)
end

if callback=="Vampir" then
tfm.exec.setVampirePlayer(name)
end

if callback=="Şaman" then
tfm.exec.setShaman(name)
end

if callback=="Rosu" then
tfm.exec.setNameColor(name, 0xCB546B)
end

if callback=="Verde" then
tfm.exec.setNameColor(name, 0x30BA76)
end

if callback=="Gaura" then
tfm.exec.playerVictory(name)
end

if callback=="Zapada" then
tfm.exec.snow()
end

if callback=="Mort" then
tfm.exec.killPlayer(name)
end

if callback=="Meep" then
tfm.exec.giveMeep(name)
end

if callback=="+10" then
tfm.exec.setPlayerScore(name, 10, true)
end

if callback=="Branza" then
tfm.exec.giveCheese(name)
end

if callback=="Blue" then
tfm.exec.setNameColor(name, 0x2E72CB)
end
end
13- تجميد الاعب من خلال هذا الامر !c
Code:
for i,command in ipairs({"c"}) do system.
disableChatCommandDisplay(command,true)
end

function eventChatCommand(answer,command)
if command:sub(1,1)=="c" then
if tfm.get.room.playerList[answer] then
local y = tfm.get.room.playerList[answer].y
local x = tfm.get.room.playerList[answer].x
tfm.exec.addShamanObject(54, x, y, 0, 0, 0, false)
tfm.exec.killPlayer(""..answer.."")
end
end
end
14- كتابه !فوز , !جبن او !لون مع الكود تبع اللون
Code:
function eventChatCommand(p,cm)
if cm == [[لون]] then
tfm.exec.setNameColor(p, 0x(Color code))[/spoiler][spoiler]
end
end
function eventChatCommand(p,cm)
if cm == [[فوز]] then
tfm.exec.playerVictory(p)
end
end
function eventChatCommand(p,cm)
if cm == [[جبن]] then
tfm.exec.giveCheese(p)
end
end
 
Last edited:

Commandoskil

Retired AR Staff
:eek: = : o event: open without space
sorry the new forum ! :'(
--------
بدون مسافه و اسف انه المنتدى الجديد يفكر انها ايموجى
 

Commandoskil

Retired AR Staff

Rxo

Well-Known Mouse
عمل جيد و أتمنى ان اتعلم تالك اللغه البرمجيه "لوا" و حظ سعيد
 

Xxalixx

MAH CHEESE!
شكرا لك :)

XXALIXX
1501682118465.png
 

Yox

Little Mouse
شكرا ع السكربتات . لكن هناك اخطاءُ املائية
 

Mohamed_o

Little Mouse
الموضوع يحتاج بعض التعديلات
ليس لدى وقت ولكن سوف احاول فى تحسين الموضوع
 

Commandoskil

Retired AR Staff
الموضوع يحتاج بعض التعديلات
ليس لدى وقت ولكن سوف احاول فى تحسين الموضوع
عفواً , ولكن من طلب منك المساعدة ؟
و ان لم يكن هناك وقت لك لا تكتب هذا الكلام لانة يوجة لي شئ مهين.
 

Mohamed_o

Little Mouse
صديقى لاشئ مهين لك فقط احاول مساعدتك وسوف احاول تحسين هذا الموضوع من اجل العرب وليس من اجل لك شكرا علد تفهمك صديقى
 

Commandoskil

Retired AR Staff
صديقى لاشئ مهين لك فقط احاول مساعدتك وسوف احاول تحسين هذا الموضوع من اجل العرب وليس من اجل لك شكرا علد تفهمك صديقى
واكنى لا اريد المساعدة شكراً لك.
 

Z_lx

Shaman
قلت لك انا لااساعدك ولكن احب مساعدة الناس
لقد خارجنا عن الموضوع يجب ان نتحدث فى الخاص
._. لية متكملو هنا
 
Top
"Dev-TR" theme by Soulzone