Simulate creating your own Player objects and Class.
local PlayerTemplate = {}
PlayerTemplate.__index = PlayerTemplate
function PlayerTemplate.new(Player: Player)
local Template = setmetatable({}, PlayerTemplate)
Template.Player = Player
return Template
end
function PlayerTemplate:Ban(Length: number)
--Update ban datastore e.t.c
self.Player:Kick()
end
function PlayerTemplate:ClearInventory()
end
I don’t think there is a way to directly modify the players functions, sure i could create a proxy “player” but im going to have to do that for every time a new reference to the (real) player is made, which completely defeats the purpose, i could just do the require(…).ban(ply) which would be better than making an entire new metatable for every reference of the player…
What i was specifically looking for was to modify the Player metatable (once on init) and it will keep it and apply globally (obviously not replicated but different server scripts access the new players mt) for any time for any time i invoke my custom :func() on the player, which i guess is not possible
‘interface’ in this context would be referring to a way to interact with the ‘Player’ object. The metatable of a ‘Player’ object (userdata value) is locked as previously mentioned in the thread.