I’m trying to make a random script for my game that kicks you if you are using the shout on a curtain group. It’s seems random but i think it will be a funny thing to add to my game.
The only way I’ve been able to find is using the Group Shout Api, sadly I don’t know how to use it in studio. If it’s not possible please let me know, thanks.
Like this, I’m trying to see if there’s a way to find out who shouted. Then whoever shouted gets kicked.
For example the image down below, ThomasDavid would get kicked for using the shout.
It is, you’ll just have to use this API instead. Here is an example script which I’d say it should work:
local HttpService = game:GetService("HttpService")
local GroupID = 0000000 --Change this to your group ID
while true do
local Data = HttpService:GetAsync("https://groups.rprxy.xyz/v1/groups/"..GroupID)
Data = HttpService:JSONDecode(Data)
if Data.shout then
local NameOfPoster = Data.shout.poster.username
if game:GetService("Players"):FindFirstChild(NameOfPoster) then
game:GetService("Players"):FindFirstChild(NameOfPoster):Kick()
end
end
wait(1)
end
Make sure that you enable HTTP requests in the game settings also I have tested this new script and it worked for me you’ll just have to wait so http response is going to be true since the proxy is overused for some reason. You must be the owner of group if you want to test inside roblox studio.
local HttpService = game:GetService("HttpService")
local GroupID = 3396474 --Change this to your group
local Data
while true do
local correct, notcorrect = pcall(function()
Data = HttpService:GetAsync("https://groups.rprxy.xyz/v1/groups/"..tostring(GroupID))
Data = HttpService:JSONDecode(Data)
end)
if correct then
if Data["shout"] ~= nil then
local NameOfPoster = Data["shout"]["poster"]["username"]
print("Shout was sent by "..NameOfPoster)
if game:GetService("Players"):FindFirstChild(NameOfPoster) then
game:GetService("Players"):FindFirstChild(NameOfPoster):Kick()
end
else
warn("Response from API doesn't have a table of shout")
end
else
warn("Game couldn't get API response")
end
wait(1)
end