Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why won't my join log/chat log script work in the real game?

basicly when you join it puts whjo joins and what they said in the discord channels. It works in studio and studio testing with the server but not the actualy real game for some reason.

Discord API

--[[
	Discord - Roblox hookup
	ConfidentCoding
	Do not touch this script.
--]]

local webHook = {}
webHook.__index = webHook

function webHook.new(id,key) 
	local mt = setmetatable({id=id,key=key}, webHook) 
	return mt
end

function webHook:post(config,host)
	local data = nil
	local success = pcall(function()
		data = game:GetService("HttpService"):JSONEncode(config)
	end)
	if not success then warn("Webhook can't be converted to JSON") return end
	game:GetService("HttpService"):PostAsync("https://discordapp.com/api/webhooks/"..self.id.."/"..self.key,data)
end

return webHook

JoinLogger

--[[
	ConfidentCoding
	in order for this to work please watch the following short tutorial:
	https://youtu.be/KxkWNJ6ZLMw
--]]
local APIModule  = require(script.Parent)



local newWebHook = APIModule.new("--Cannot Expose--","--Cannot Expose--")

game.Players.PlayerAdded:Connect(function(Player)
newWebHook:post{
			username = "Player",
			content = "**" .. Player.Name .. "** has joined the server"
		}
end)

Chat Logger

--[[
	ConfidentCoding
	in order for this to work please watch the following short tutorial:
	https://youtu.be/KxkWNJ6ZLMw
--]]
local APIModule  = require(script.Parent)

local newWebHook = APIModule.new("--Cannot Expose--","--Cannot Expose--")

game.Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(msg)
		newWebHook:post{
			username = Player.Name,
			content = msg
		}
	end)	
end)

Is there any fix?

1 comment

0

Free model code

1 answer

✓ Accepted answer

Requests from discordapp.com is blocked, to fix:

Simply replace https://discordapp.com in your webhook url to https://discord.osyr.is

^ this is a proxy server made by Osyris solely for the purpose of discord proxy.

Also, your webhook requests WILL also get blocked if you abuse and go over the API limits.

What I mean by that; I don't recommend using a chat logger or a join log. These requests will most likely get blocked due to it being requested almost every single second.

You can simply unblock your requests by creating a new webhook; but you'll end up having to keep changing it over and over and over again. Might aswell not bother at all.

for more stuff, view here: https://devforum.roblox.com/t/roblox-discord-webhook-proxy-server/98825

This discussion is preserved as it was. New answers, comments, and votes are closed.