-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPlayers.py
29 lines (26 loc) · 864 Bytes
/
Players.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
This class is useful for players management
"""
from .Exploit import roblox
from .instance import Instance
from .Memory import GetDataModel, float_to_hex
from .Player import Player
class Players(Instance):
def __init__(self, instance : Instance) -> None:
super().__init__(instance.getAddress())
def GetLocalPlayer(self) -> Instance:
return self.GetChildren()[0] # The first instance is always the local player
def GetLocalPlayerChar(self, workspace) -> Instance:
if type(workspace) != Instance:
print("nah")
else:
LP = self.GetLocalPlayer()
return workspace.FindFirstChild(LP.GetName())
def GetAllPlayers(self) -> list[Player]:
plrs = []
for players in self.GetChildren():
plrs.append(players)
return plrs
__all__ = [
"Players"
]