A secure Vercel-deployed JavaScript API that serves Roblox Lua scripts with authentication and User-Agent validation.
API آمن مُنشر على Vercel يخدم سكريبت Roblox Lua مع المصادقة والتحقق من User-Agent.
- ✅ Secure API endpoint with secret-based authentication
- ✅ User-Agent validation for Roblox clients
- ✅ Returns Roblox Lua scripts as plain text
- ✅ Proper error handling and HTTP status codes
- ✅ Ready for Vercel deployment
- ✅ Environment variable configuration
secret(required): Authentication secret
User-Agent(required): Must contain "Roblox"
200 OK: Returns Lua script as plain text403 Forbidden: Invalid secret or User-Agent405 Method Not Allowed: Non-GET requests500 Internal Server Error: Server error
- اذهب إلى GitHub.com وسجل دخولك
- اضغط على زر "New repository" أو "+" ثم "New repository"
- املأ البيانات التالية:
- Repository name:
roblox-script-api - Description:
API آمن لتقديم سكريبت Roblox Lua مع المصادقة - اختر Public أو Private حسب رغبتك
- لا تضع علامة على "Add a README file" لأنه موجود بالفعل
- Repository name:
- اضغط "Create repository"
بعد إنشاء Repository، استخدم هذه الأوامر في Terminal:
# إضافة جميع الملفات
git add .
# إنشاء commit
git commit -m "Initial commit: Roblox Script API with authentication"
# ربط المشروع بـ GitHub (غير <username> و <repository-name> بالأسماء الصحيحة)
git remote add origin https://github.com/<username>/<repository-name>.git
# رفع الملفات
git push -u origin main- اذهب إلى vercel.com وسجل دخولك
- اضغط "New Project"
- اختر "Import Git Repository"
- اختر repository الخاص بك
roblox-script-api - في إعدادات Environment Variables، أضف:
API_SECRET: ضع كلمة السر الخاصة بك (مثل:my_secure_secret_key_2024)
- اضغط "Deploy"
# تثبيت Vercel CLI
npm install -g vercel
# تسجيل الدخول
vercel login
# نشر المشروع
vercel
# إضافة متغير البيئة
vercel env add API_SECRETgit clone https://github.com/<your-username>/roblox-script-api.git
cd roblox-script-api
npm install
# تشغيل السيرفر محلياً للاختبار
npm start-- مثال على كيفية استدعاء API من داخل Roblox
local HttpService = game:GetService("HttpService")
-- تأكد من تفعيل HTTP Requests في Game Settings > Security > Allow HTTP Requests
local function loadScriptFromAPI()
local success, result = pcall(function()
local response = HttpService:GetAsync(
"https://your-vercel-app.vercel.app/api/script?secret=your_secret_key_here",
false, -- لا نحتاج sync
{
["User-Agent"] = "Roblox/WinInet"
}
)
return response
end)
if success then
print("تم تحميل السكريبت بنجاح!")
-- تنفيذ السكريبت المُحمّل
loadstring(result)()
else
print("خطأ في تحميل السكريبت:", result)
end
end
-- استدعاء الدالة
loadScriptFromAPI()- في Roblox Studio، اذهب إلى:
Game Settings>Security- فعّل
Allow HTTP Requests
- ضع السكريبت أعلاه في
ServerScriptService - غيّر الرابط ليطابق رابط Vercel الخاص بك
- غيّر
your_secret_key_hereإلى كلمة السر الصحيحة
local HttpService = game:GetService("HttpService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local API_URL = "https://your-vercel-app.vercel.app/api/script"
local API_SECRET = "your_secret_key_here"
local function loadAndExecuteScript()
local url = API_URL .. "?secret=" .. API_SECRET
local success, response = pcall(function()
return HttpService:GetAsync(url, false, {
["User-Agent"] = "Roblox/WinInet"
})
end)
if success then
print("✅ تم تحميل السكريبت من API")
-- تنفيذ السكريبت
local executeSuccess, executeError = pcall(function()
loadstring(response)()
end)
if executeSuccess then
print("✅ تم تنفيذ السكريبت بنجاح")
else
print("❌ خطأ في تنفيذ السكريبت:", executeError)
end
else
print("❌ خطأ في تحميل السكريبت:", response)
end
end
-- تنفيذ السكريبت
loadAndExecuteScript()- لا تشارك API Secret مع أي شخص
- استخدم كلمة سر قوية ومعقدة
- غيّر كلمة السر بانتظام
- راقب استخدام API من خلال Vercel Analytics
- API يتحقق من User-Agent ليتأكد أن الطلب من Roblox
- يرفض جميع الطلبات بدون كلمة السر الصحيحة
- يسجل جميع المحاولات للوصول غير المصرح
- 403 Forbidden: تأكد من صحة كلمة السر
- HTTP not enabled: فعّل HTTP Requests في Game Settings
- User-Agent مرفوض: تأكد من استخدام User-Agent صحيح
- CORS errors: API يدعم CORS تلقائياً
# اختبار مع curl
curl -H "User-Agent: Roblox/WinInet" \
"https://your-vercel-app.vercel.app/api/script?secret=your_secret_key"