require(assetId) cannot be called from a client

I am currently working on a side project in the form of something which I believe could be a fun and original game idea good for short gameplay. One of the main mechanics of this game would be sending an embed to a DC server through a webhook if a new “submission” is sent.

I found a guide on how to send the embeds, however, the problem is Roblox is refusing to let me request the module that would do the job for me.

local Discord = require(11780461670)
local button = script.Parent

Discord.SetWebhook("https://discord.com/api/webhooks/1259110789449650226/C7IYPeH1vnOSZUTPizKk7aGiWbOyjq32CqlcZyhaWmQJtsK9HCKrAXPUTRFu_0JHCWHW")

script.Parent.MouseButton1Click:Connect(function()
	local input = script.Parent.Parent.TextBox.Text
	script.Parent.Parent.TextBox.Text = ""
	Discord.Embed("", input, "A new submission has been made.", "0xF57D34")
end)

Unfortunately, as I am incredibly dumb and have no experience in Lua scripting, I couldn’t find a solution I would understand. Any ideas on what’s wrong with my code?

Create a “Script” in serverscriptservice instead of a local script. I assume you’;d know how to that.
Then just paste the same code.

2 Likes

I’m glad it worked. Have fun with whatever you’re doing. :smiley:

2 Likes

Thanks! Hopefully, I’ll be able to get over all the bugs I’m finding right now and make a simple working game. :slight_smile:

1 Like