Uh. Yeah I’m not sure whats going on chief if print doesn’t work lol. Aside from that 99% of the time its a problem with discord translation. Meaning its just discord saying no lol.
Could it be your player is being added before the script can detect you?
Try putting the code in the PlayerAdded in a function and go through the players ingame first and call the function each of them and then set up the playeradded event with that function?
The thing is, I tried this earlier (about a day ago) using HttpService, not the module, and it was working fine.
I believe it’s a problem with the module
Try running the post Method outside of the PlayerAdded with some random data to see if it’s actually an issue with your module or an issue with t he event not firing in time
Output:
Code:
local HttpService = game:GetService("HttpService")
local Webhook = require(script.WebhookModule)
print("LUA")
local MyHook = Webhook.new("")
print("PARZIVAL")
MyHook:Post("Hello, World! PK")
You’d have to format the Content data properly, right now it’s just a string, the webhook expects a dictionary, so maybe try this?
local data = {
["content"] = "Hello world!"
}
MyHook:Post(data)
And add some print statements in the post method to see where it’s having problems? What the full code in your post method?
Oh my, I completely forgot. 1 second
Alrighty, that posted fine.
(random text here)
Then nothing’s wrong with your Module, it’s the way you set up the PlayerAdded. Most definitely it hasn’t detected your Player instance in time, so it got added before the PlayerAdded event got made, which would explain why your print didn’t print in the event either. You could try to do something like this?
local function playerHandling(player)
--Code here
end
for _,player in pairs(game:GetService("Players"):GetPlayers()) do
playerHandling(player)
end
game:GetService("Players").PlayerAdded:Connect(playerHandling)
Oh my, its one of those weird-catastrophic studio failures again.
Thank you!
Final code:
local function handlePost(Player)
warn(Player.Name)
MyHook:Post({
["embeds"] = {{
["title"] = string.format("**Wassup, %s?**", Player.Name),
["description"] = string.format("Wassup, %s?", Player.Name)
}}
})
end
for _, Player in pairs(game.Players:GetPlayers()) do
handlePost(Player)
end
game.Players.PlayerAdded:Connect(handlePost)