[DiscordArchive] ```local PACKET_EVENT_ON_PACKET_RECEIVE = 5
[DiscordArchive] ```local PACKET_EVENT_ON_PACKET_RECEIVE = 5
Archived author: Nocty1501 • Posted: 2023-12-03T21:19:25.874000+00:00
Original source
```local PACKET_EVENT_ON_PACKET_RECEIVE = 5
local CMSG_REPOP_REQUEST = 346
local CMSG_RECLAIM_CORPSE = 466
local CMSG_SPIRIT_HEALER_ACTIVATE = 540
local function OnAttemptRevive(event, packet, player)
player:SendNotification("You are already lost...")
return false
end
RegisterPacketEvent(CMSG_RECLAIM_CORPSE, PACKET_EVENT_ON_PACKET_RECEIVE, OnAttemptRevive(event, packet, player))
RegisterPacketEvent(CMSG_RECLAIM_CORPSE, PACKET_EVENT_ON_PACKET_RECEIVE, OnAttemptRevive(event, packet, player))
RegisterPacketEvent(CMSG_SPIRIT_HEALER_ACTIVATE, PACKET_EVENT_ON_PACKET_RECEIVE, OnAttemptRevive(event, packet, player))```
what did I screw up?
Archived author: Honey • Posted: 2023-12-03T21:21:14.010000+00:00
Original source
There's no player object. You need to evaluate if it's an issue that there's no `player` object available.
Archived author: Honey • Posted: 2023-12-03T21:21:52.677000+00:00
Original source
To solve the bug, do
```lua
if player then
<do stuff>
end
return false
```
Archived author: Honey • Posted: 2023-12-03T21:22:11.302000+00:00
Original source
However, your message won't be sent
Archived author: Honey • Posted: 2023-12-03T21:22:18.036000+00:00
Original source
in that specific case.
Archived author: Nocty1501 • Posted: 2023-12-03T21:22:32.208000+00:00
Original source
I don't get it. how is this function even being called without a player?
Archived author: Honey • Posted: 2023-12-03T21:23:20.715000+00:00
Original source
I'm just guessing, but if the player is dad, there might be no player object.
Archived author: Nocty1501 • Posted: 2023-12-03T21:23:55.552000+00:00
Original source
eh...? that can't be right
Archived author: Honey • Posted: 2023-12-03T21:24:42.044000+00:00
Original source
Let us know what you found out
Archived author: Nocty1501 • Posted: 2023-12-03T21:28:40.327000+00:00
Original source
oh, of course