[DiscordArchive] Show the whole function?
[DiscordArchive] Show the whole function?
Archived author: Honey • Posted: 2023-09-27T13:35:09.167000+00:00
Original source
Show the whole function?
Is player a player object?
eleteMember(player, false)Archived author: Trojan • Posted: 2023-09-27T13:35:18.720000+00:00
Original source
```lua
local function PlayerDeath(event, player, killer)
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
```
Archived author: Trojan • Posted: 2023-09-27T13:36:19.065000+00:00
Original source
yes player is a object. found out when i get killed by another player it works fine
Archived author: Honey • Posted: 2023-09-27T13:37:50.395000+00:00
Original source
HasItem exists according to the wiki.
Do a
```lua
print(player:GetGuid())
```
In the line before to check the object?
Archived author: Trojan • Posted: 2023-09-27T13:38:03.873000+00:00
Original source
yes
Archived author: Honey • Posted: 2023-09-27T13:39:18.465000+00:00
Original source
Did you register the death event?
Archived author: Trojan • Posted: 2023-09-27T13:39:34.039000+00:00
Original source
yes
Archived author: Honey • Posted: 2023-09-27T13:40:18.384000+00:00
Original source
So it prints the guid now?
Or does the error happen when you do reload eluna?
Archived author: Trojan • Posted: 2023-09-27T13:40:38.414000+00:00
Original source
no i need to restart
Archived author: Trojan • Posted: 2023-09-27T13:40:46.266000+00:00
Original source
because reload eluna wont reload the file