cloneref
Returns a safe reference clone of an Instance to defeat weak-table detections.
function cloneref<T>(objectobjectInstanceThe Instance to create a safe reference from.: T & Instance): TInstanceA new reference to the same Instance. Not == to the original, but compareinstances() returns true.Usage
Safe access to LocalPlayer
local Players = game:GetService("Players")
local safe = cloneref(Players.LocalPlayer)
print(safe == Players.LocalPlayer) -- false
print(safe.Name) -- your username
print(compareinstances(safe, Players.LocalPlayer)) -- true