[DiscordArchive] Show the whole function?
[DiscordArchive] Show the whole function?
eleteMember(player, false)Archived author: Trojan • Posted: 2023-09-27T13:43:17.803000+00:00
Original source
```lua
local function PlayerDeath(event, player, killer)
print(player:GetGuid())
if player:HasItem(666, 1) then
-- Get Player Information
local playerGUID = player:GetGUIDLow()
local playerName = player:GetName()
local playerLevel = player:GetLevel()
-- Check if the player is in the "HardCore" guild
local guild = player:GetGuild()
if guild and guild:GetName() == "HardCoded" then
guild
eleteMember(player, false)
SendWorldMessage("|cFFffffffHardcore|r : |cFF007bf6" .. playerName .. " was removed from the Hardcore Guild!|r")
end
local players = GetPlayersInWorld()
local killerName = ""
if killer then
killerName = killer:GetName()
end
-- Broadcast Message to other players in the world
for _, p in ipairs(players) do
p:SendBroadcastMessage("|cFFffffffHardcore|r : |cFFffffffUser |cFF00ff00" .. playerName .. "|r |cFFffffffwas killed by |cFF00ff00" .. killerName .. "|r - |cFFffffffLevel " .. playerLevel .. "")
p:SendAreaTriggerMessage("|cFFffffffHardcore|r : |cFFffffffUser |cFF00ff00" .. playerName .. "|r |cFFffffffwas killed by |cFF00ff00" .. killerName .. "|r - |cFFffffffLevel " .. playerLevel .. "")
end
local input_HC_Dead = "INSERT INTO hc_dead_log (username, level, killer, date, result, guid) VALUES ('" .. player:GetName() .. "', '" .. player:GetLevel() .. "', '" .. killer:GetName() .. "', NOW(), 'DEAD', '" ..playerGUID.."')"
AuthDBExecute(input_HC_Dead)
-- Remove Hardcore Item from player
player:RemoveItem(666, 1)
end
end
RegisterPlayerEvent(6, PlayerDeath)
```
Archived author: Honey • Posted: 2023-09-27T13:43:43.031000+00:00
Original source
PLAYER_EVENT_ON_KILL_PLAYER = 6, // (event, killer, killed)
Archived author: Foe • Posted: 2023-09-27T13:43:51.301000+00:00
Original source
That's whenever a player kills another player
Archived author: Trojan • Posted: 2023-09-27T13:43:53.090000+00:00
Original source
aaaah DAMN
Archived author: Trojan • Posted: 2023-09-27T13:44:03.139000+00:00
Original source
why it gets triggered then
Archived author: Trojan • Posted: 2023-09-27T13:44:04.722000+00:00
Original source
wtf
Archived author: Foe • Posted: 2023-09-27T13:44:23.346000+00:00
Original source
Environmental deaths are triggered by the same event, but killer is nil
Archived author: Trojan • Posted: 2023-09-27T13:44:27.224000+00:00
Original source
when its the wrong event why it gets triggered when i get killed by a mob
Archived author: Foe • Posted: 2023-09-27T13:44:40.063000+00:00
Original source
It shouldn't trigger when you get killed by a creature
Archived author: Trojan • Posted: 2023-09-27T13:44:48.617000+00:00
Original source
yes