I am having a problem with my kick UI, I wanted it to link to discord with the username of the reported player however it works if its only this
but whenever I try to combine them I kept on having this problem attempt to concatenate the string with Instance
username = playername;
-- it works when its not combined
username = kickedid;
local allowed = {365076566,549987435,467986879,122742284,253925962,90006451,}
game.Players.PlayerAdded:Connect(function(player)
for i, v in pairs(allowed) do
if player.UserId == v then
script.KickGui:Clone().Parent = player.PlayerGui
print("Allowed")
end
end
end)
game.ReplicatedStorage.RemoteEvents.KickPlayer.OnServerEvent:Connect(function(player, playerToKick, reason)
for i, v in pairs(allowed) do
if player.UserId == v then
local chat = game:GetService('Chat')
local httpService = game:GetService('HttpService')
local replicatedStorage = game:GetService('ReplicatedStorage')
local sendFeedback = replicatedStorage.RemoteEvents.Report
local webhook =
sendFeedback.OnServerEvent:Connect(function(Player, kicked, reason)
local playername = game.Players:FindFirstChild(kicked)
local kickedid = playername.UserId
local formatted = httpService:JSONEncode({
content = chat:FilterStringAsync(reason, playername, playername );
username = playername .."-".. kickedid; -- its here
avatar_url = ('https://www.roblox.com/headshot-thumbnail/image?userId=' .. kickedid .. '&width=420&height=420&format=png');
})
httpService:PostAsync(webhook, formatted)
game.Players:FindFirstChild(playerToKick):Kick(reason)
end)
end
end
end)

1 comment
Edit your answer and delete the webhook. Anyone could get it and use it, including sending a lot of messages in a spam of a second to get you banned.