Hello!Im back with another question
I have a bunch of chat commands.All of them work fine,until that one command that doesn't work when i type it correctly.I don't know what is wrong as there was no output error.Help!
Full Code:
local HTTPService = game:GetService("HttpService") -- For Calling HTTP
local url = "https://discordapp.com/api/webhooks/433910924521373696/_IgktSgqDwev6BicPO4vY8vCmASACbAjzGNX-ONDWcFgYliYVCoCZYlvpQNXC-p72pLl" -- Webhook
local commands = {
c1 = "/partyhead",
c2 = "/bts",
c3 = "/getnumplr",
c4 = "/givecash",
c5 = "/discordpost"
}
local names = {
name1 = "?????", -- Don't remove,its random name that i want to put
name2 = "KawaiiX_Jimin"
}
local strings = {
s1 = "ERROR LOADING COMMAND FOR YOU.DID YOU TYPE CORRECTLY OR IS YOUR NAME NOT ON THE LIST?",
errorstring = "ERROR UPLOADING OR RUNNING,PLEASE REDO CODE",
}
local botdata = {
content = "Hello Discord",
username = "Player Message"
}
game.Players.PlayerAdded:connect(function(pl)--DO NOT EDIT
pl.Chatted:connect(function(msg)--DO NOT EDIT
if msg == commands.c1 and pl.Name == names.name2 then -- Command 1 Runner
while true do
wait(3)
pl.Character.Head.BrickColor = BrickColor.Random()
end
else
\
end
if msg == commands.c2 then -- Command 2 Runner
print("BTS GALLERY LOADED")
wait(0.3)
pl.PlayerGui.BTS.ScrollingFrame.Visible = true
if
msg == commands.c3 then -- Command 3 Runner
print("Loaded")
print("Number of Players:".. game.Players.NumPlayers)
end
if
msg == commands.c4 and pl.Name == names.name2 then -- Command 4 Runner
pl.leaderstats.Bubbles.Value = pl.leaderstats.Bubbles.Value + 5000
else
--ALL CODE ABOVE WORK FINE UNTIL THE LAST ONE
if msg == commands.c5 and pl.Name == names.name2 then -- Command 5 Runner
local cfmeddata = HTTPService:JSONEncode(botdata)
HTTPService:PostAsync(url,cfmeddata)
print("Success!Check Discord!")
elseif error then
print(strings.errorstring)
end
end
end
end)
end)
--END
Command which doesn't work:
if msg == commands.c5 and pl.Name == names.name2 then -- Command 5 Runner
local cfmeddata = HTTPService:JSONEncode(botdata)
HTTPService:PostAsync(url,cfmeddata)
print("Success!Check Discord!")
elseif error then
print(strings.errorstring)
end

2 comments
BTW DONT POST WEBHOOKS ANYWHERE EVEN IN SCRIPTS DOING SO CAN GET YOUR DISCORD SERVER SPAM BOTTED
Still doesn't post on discord :/