You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Send a webhook with text written in the textbox
What is the issue? Include screenshots / videos if possible!
I just cannot make it to work please help
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
changing to remote event, didnt help or im just really bad at them.
--localscript
local RS = game:GetService("ReplicatedStorage")
local user = game:GetService("Players").LocalPlayer
local WLRequire = require(RS.WhitelistModuleScript)
local Owners = WLRequire.Owners
script.Parent.MouseButton1Click:Connect(function()
if table.find(Owners, game.Players.LocalPlayer.Name) then
RS:FindFirstChild("FireEvent"):FireServer(script.Parent.Parent.UsernameBox.Text, script.Parent.Parent.UserIdBox.Text)
script.Parent.Script:Destroy()
else
game.Players.LocalPlayer:Kick("Detected Exploits CODE: Firing RemoteEvent")
script.Parent.Script:Destroy()
end
end)
--server script
RS:FindFirstChild("FireEvent").OnServerEvent:Connect(function(usernametext, useridtext)
if script.Parent.Parent.addedButton.BackgroundColor3 == Color3.fromRGB(20, 20, 20) then
local fields = {
{
['name'] = "User: "..usernametext.Text, <-- here problem
['value'] = "UserId: "..useridtext.PlayerGui.MainMenuGUI.WhitelistFrame.UserIdBox.Text, <-- this doesnt work too, i tried it too
['inline'] = false
}
}
req.Title = "Added to whitelist"
if script.Parent.Parent.F1reButton.BackgroundColor3 == Color3.fromRGB(10, 10, 10) then
req.Description = "Admin that added: catkingsteam (ItzSzmaragd)"
else
req.Description = "Admin that added: sheluvs.ailly (kabanosjestfajny)"
end
req.Color = ws.colors.green
req.Fields = fields
req.Thumbnail = ""
req.Footer = "Coded by F1re"
req.FooterIcon = ""
req:sendEmbed(url)
else -- theres more code then, but its not needed to add here.
OnServerEvent provides the player as first parameter by default, so you’re trying to index the player with .Text. Just define the parameter even if you’re not going to use it.
It means usernametext is an instance, probably the TextLabel, try to index it with .Text. If it doesn’t work check the arguments that you’re passing through the :FireServer() function.
I think you misunderstood what I said. You’re now passing the player instance as an argument too, so the parameters are looking like this: (player, player, usernametext, useridtext). You don’t need to pass the player, the event gets it by default.
Hm, seems to do work because there are no errors but when it sends a discord webhook because thats what im trying to do, user: and userid: are blank i dont know why