I'm not exactly sure how to combine two scripts, but I have my base script here to detect when a player has died and send it to discord
local Players = game:GetService("Players") local HttpService = game:GetService("HttpService") game:GetService('Players').PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(player) player:WaitForChild("Humanoid").Died:Connect(function() local data = { content = player.Name .. " has died!"; username = "KillBot", avatar_url = "http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username="..player.Name } print(player.Name .. " has died!") local webhook = "https://discordapp.com/api/webhooks/00000000000" HttpService:PostAsync(webhook, HttpService:JSONEncode(data)) end) end) end)
How would I go about adding this to the script?
if Humanoid:FindFirstChild("creator") ~= nil then local Killer = Humanoid.creator.Value
Everytime I add the last one I get an error saying end expected (. Thank you for the help.
local creator = Humanoid:FindFirstChild("creator") if creator then -- every if statement is followed by an end afterwards local killer = creator.Value end -- this is to show the "end" of the stuff that happens after the if statement
If you have any questions, let me know <3