Issues with promotion/demotion tool

I completed everything with the promotion/demotion tool point by point and as said, and even when going into test play in roblox studios it worked.

However, when I went into my game it did not work.

How can I place what I did in the downloaded rblx file into my game so that this tool can work?

Please let me know as soon as possible!

Thanks.

Hey! Please post this in #scripting-support with scripts amd logs.

alright, I sent it to #scripting-support

what logs should I send to better help?

What tutorial did you follow first off?

Roblox rank bot then how to make a promote demote command

Can you show me any scripts or any logs or something to help you out with?

1 Like

Please send your scripts using the </> tool.

They should look like this.

sorry, the codes and scripts work in the baseplate that was in the tutorial.

I am just not sure how I can put it in my training center.

Ohhh, then just open up every category - and copy everything but baseplate, spawn, etc.

Should help, if this is the solution mark it as so,

alright, so it is now in my game but when a user joins and I try to promote them or someone else tries to promote them it says attempting then uh oh, we couldn’t process the promotion

Did you add in the api key, etc?

yep! i did

(this is here bc 20 characters)

Can we see the logs?

No one here can help you if you don’t give us scripts/logs or something.

alright, I will send it in a bit since im not home.

1 Like

Manager script in “ServerScriptServices”

local HttpService = game:GetService("HttpService")
local ReplicatedStorage = game.ReplicatedStorage
local AppUrl = script.AppUrl.Value
local ApiKey = script.ApiKey.Value
local Groupid = script.GroupId.Value
local MinRank = script.MinRank.Value
local prefix = "!"



local function FindPlr(plr)
	local foundPlr = nil
	local plrs = game.Players:GetPlayers()
	for i = 1, #plrs do
		local current = plrs[i]
		if string.lower(current.Name):sub(1, #plr) == string.lower(plr) then
			foundPlr = current.Name
			break
		end
	end
	return foundPlr
end


game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(msg)
		if player:GetRankInGroup(Groupid) >= 2 then
			local LowerCaseMessage = string.lower(msg)
			if string.find(LowerCaseMessage, prefix.. "promote") then
				local SplitMessage = string.split(msg, " ")
				local full_player = FindPlr(SplitMessage[2])
				if full_player == nil then
					local playerInstance = game.Players:FindFirstChild(player.Name)
					game.ReplicatedStorage.Notify:FireClient(playerInstance, "Uh-Oh","We couldn't find the player you wanted to promote!")
				else
					local playerInstance = game.Players:FindFirstChild(player.Name)
					game.ReplicatedStorage.Notify:FireClient(playerInstance, "Attempting.","Attempting to promote user...")
					local Url = script.AppUrl.Value.."group/promote?user_name="..full_player.."&key=" ..script.ApiKey.Value.."&groupid="..script.GroupId.Value
					local success, response = pcall(function()
						local response = HttpService:GetAsync(Url)
						local data = HttpService:JSONDecode(response)
					end)
					if success then
						game.ReplicatedStorage.Notify:FireClient(playerInstance, "Horrah!","We promoteed the user!")
					else
						game.ReplicatedStorage.Notify:FireClient(playerInstance, "Uh-Oh","We had problems promoting the user.")
					end
				end
			else if string.find(LowerCaseMessage, prefix.. "demote") then
					local SplitMessage = string.split(msg, " ")
					local full_player = FindPlr(SplitMessage[2])
					if full_player == nil then
						local playerInstance = game.Players:FindFirstChild(player.Name)
						game.ReplicatedStorage.Notify:FireClient(playerInstance, "Uh-Oh","We couldn't find the player you wanted to demote!")
					else
						local playerInstance = game.Players:FindFirstChild(player.Name)
						game.ReplicatedStorage.Notify:FireClient(playerInstance, "Attempting.","Attempting to demote user...")
						local Url = script.AppUrl.Value.."group/demote?user_name="..full_player.. "&key=" ..script.ApiKey.Value.. "&groupid=" ..script.GroupId.Value
						local success, response = pcall(function()
							local response = HttpService:GetAsync(Url)
							local data = HttpService:JSONDecode(response)
						end)
						if success then
							game.ReplicatedStorage.Notify:FireClient(playerInstance, "Horrah!","We demoted the user!")
						else
							game.ReplicatedStorage.Notify:FireClient(playerInstance, "Uh-Oh","We had problems demoting. the user.")
						end
					end
				end
			end
		end
	end)
end)

This won’t help us, we will need to see the heroku logs.

1 Like

Is this the correct one?

-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Python app detected
-----> No Python version was specified. Using the buildpack default: python-3.10.5
       To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python-3.10.5
-----> Installing pip 22.1.2, setuptools 60.10.0 and wheel 0.37.1
-----> Installing SQLite3
-----> Installing requirements with pip
       Collecting fastapi==0.65.2
         Downloading fastapi-0.65.2-py3-none-any.whl (51 kB)
       Collecting ro_py==1.2.0.5
         Downloading ro_py-1.2.0.5-py3-none-any.whl (69 kB)
       Collecting asyncio==3.4.3
         Downloading asyncio-3.4.3-py3-none-any.whl (101 kB)
       Collecting python-dotenv==0.16.0
         Downloading python_dotenv-0.16.0-py2.py3-none-any.whl (18 kB)
       Collecting uvicorn==0.14.0
         Downloading uvicorn-0.14.0-py3-none-any.whl (50 kB)
       Collecting pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2
         Downloading pydantic-1.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB)
       Collecting starlette==0.14.2
         Downloading starlette-0.14.2-py3-none-any.whl (60 kB)
       Collecting lxml
         Downloading lxml-4.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (6.9 MB)
       Collecting iso8601
         Downloading iso8601-1.0.2-py3-none-any.whl (9.7 kB)
       Collecting requests
         Downloading requests-2.28.0-py3-none-any.whl (62 kB)
       Collecting httpx
         Downloading httpx-0.23.0-py3-none-any.whl (84 kB)
       Collecting h11>=0.8
         Downloading h11-0.13.0-py3-none-any.whl (58 kB)
       Collecting asgiref>=3.3.4
         Downloading asgiref-3.5.2-py3-none-any.whl (22 kB)
       Collecting click>=7.*
         Downloading click-8.1.3-py3-none-any.whl (96 kB)
       Collecting typing-extensions>=3.7.4.3
         Downloading typing_extensions-4.2.0-py3-none-any.whl (24 kB)
       Collecting sniffio
         Downloading sniffio-1.2.0-py3-none-any.whl (10 kB)
       Collecting httpcore<0.16.0,>=0.15.0
         Downloading httpcore-0.15.0-py3-none-any.whl (68 kB)
       Collecting rfc3986[idna2008]<2,>=1.3
         Downloading rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)
       Collecting certifi
         Downloading certifi-2022.6.15-py3-none-any.whl (160 kB)
       Collecting charset-normalizer~=2.0.0
         Downloading charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
       Collecting urllib3<1.27,>=1.21.1
         Downloading urllib3-1.26.9-py2.py3-none-any.whl (138 kB)
       Collecting idna<4,>=2.5
         Downloading idna-3.3-py3-none-any.whl (61 kB)
       Collecting h11>=0.8
         Downloading h11-0.12.0-py3-none-any.whl (54 kB)
       Collecting anyio==3.*
         Downloading anyio-3.6.1-py3-none-any.whl (80 kB)
       Installing collected packages: rfc3986, python-dotenv, asyncio, urllib3, typing-extensions, starlette, sniffio, lxml, iso8601, idna, h11, click, charset-normalizer, certifi, asgiref, uvicorn, requests, pydantic, anyio, httpcore, fastapi, httpx, ro_py
       Successfully installed anyio-3.6.1 asgiref-3.5.2 asyncio-3.4.3 certifi-2022.6.15 charset-normalizer-2.0.12 click-8.1.3 fastapi-0.65.2 h11-0.12.0 httpcore-0.15.0 httpx-0.23.0 idna-3.3 iso8601-1.0.2 lxml-4.9.0 pydantic-1.9.1 python-dotenv-0.16.0 requests-2.28.0 rfc3986-1.5.0 ro_py-1.2.0.5 sniffio-1.2.0 starlette-0.14.2 typing-extensions-4.2.0 urllib3-1.26.9 uvicorn-0.14.0
-----> Discovering process types
       Procfile declares types -> web
-----> Compressing...
       Done: 40.8M
-----> Launching...
       Released v3
       https://fftranking.herokuapp.com/ deployed to Heroku

No, those are the wrong logs.

That’s build logs.

20 char