I'm attempting to access a Player Spawn point using either the "PlayerSpawn" and "MapThingSpawn" hooks, using this and this as a reference.
My code below. It's simple, but the Player Mo's spawnpoint appears to be nil when attempting to access it. It should be returning a userdata value of some kind.
The "MapThingSpawn" hook also refuses to print information for the player mobj or the corresponding player spawn point.
My code below. It's simple, but the Player Mo's spawnpoint appears to be nil when attempting to access it. It should be returning a userdata value of some kind.
Code:
addHook("PlayerSpawn", function(p)
if p and p.valid and not p.spectator
and p.mo and p.mo.valid
print("Player "+#p+" spawnpoint is "+p.mo.spawnpoint)
end
end)
The "MapThingSpawn" hook also refuses to print information for the player mobj or the corresponding player spawn point.
Attachments
Last edited: