From 71d8234040e401e3d575721c48f09c64dc1c5527 Mon Sep 17 00:00:00 2001 From: OgelGames Date: Sat, 1 Nov 2025 00:33:31 +1100 Subject: [PATCH] add `get_guid()` function to fake player --- player.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/player.lua b/player.lua index 61a0bf0..ff10643 100644 --- a/player.lua +++ b/player.lua @@ -82,6 +82,10 @@ local function check_vector(v) end end +local function new_fake_guid() + return string.format("@fakeplayer%d%d", os.time(), math.random(100, 999)) +end + -- Dynamic get/set functions ---------------------------------------- @@ -89,6 +93,13 @@ function fake_player:get_player_name() return self.data.name or "" end +function fake_player:get_guid() + if not self.data.guid then + self.data.guid = new_fake_guid() + end + return self.data.guid +end + function fake_player:get_inventory() if not self.data.inventory then self.data.inventory = fakelib.create_inventory({