local function r(r,B)if not r then return _L.Print("\070\097\105\108\101\100 \116\111 \103\114\097\098 "..(B..(" \040"..(r.Name.." \105\115 \110\105\108\041"))),true)end local p=tick()while tick()-p<=waitTimeout do local p=r:FindFirstChild(B)if p then return p end _L.Services.RunService.Heartbeat:Wait()end return _L.Print("\070\097\105\108\101\100 \116\111 \103\114\097\098 "..B,true)end Player.Get=function(B,p)if isClient then p=p or game.Players.LocalPlayer end p=type(p)=="\115\116\114\105\110\103"and game.Players:FindFirstChild(p)or p B=B or"\080\108\097\121\101\114"B=string.lower(B)local y=tick()while p and(not p.Character and tick()-y<waitTimeout)do _L.Services.RunService.Stepped:Wait()end if not p or tick()-y>=waitTimeout then return end local h=p.Character:FindFirstChild("\072\117\109\097\110\111\105\100")local K=defaultRigType if h then K=h.RigType end if K==Enum.HumanoidRigType.R6 then if B=="\116\111\114\115\111"then return r(p.Character,"\084\111\114\115\111")elseif B=="\108\101\102\116\097\114\109"then return r(p.Character,"\076\101\102\116\065\114\109")elseif B=="\108\101\102\116\108\101\103"then return r(p.Character,"\076\101\102\116\076\101\103")elseif B=="\114\105\103\104\116\097\114\109"then return r(p.Character,"\082\105\103\104\116\065\114\109")elseif B=="\114\105\103\104\116\108\101\103"then return r(p.Character,"\082\105\103\104\116\076\101\103")end end if B=="\112\108\097\121\101\114"or not B then return p elseif B=="\099\104\097\114\097\099\116\101\114"then return p.Character elseif B=="\104\101\097\100"then return r(p.Character,"\072\101\097\100")elseif B=="\116\111\114\115\111"or B=="\117\112\112\101\114\116\111\114\115\111"then return r(p.Character,"\085\112\112\101\114\084\111\114\115\111")elseif B=="\114\111\111\116\112\097\114\116"or B=="\104\117\109\097\110\111\105\100\114\111\111\116\112\097\114\116"then return r(p.Character,"\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")elseif B=="\104\117\109\097\110\111\105\100"then return r(p.Character,"\072\117\109\097\110\111\105\100")elseif B=="\108\111\119\101\114\116\111\114\115\111"then return r(p.Character,"\076\111\119\101\114\084\111\114\115\111")elseif B=="\108\101\102\116\102\111\111\116"then return r(p.Character,"\076\101\102\116\070\111\111\116")elseif B=="\108\101\102\116\104\097\110\100"then return r(p.Character,"\076\101\102\116\072\097\110\100")elseif B=="\108\101\102\116\108\111\119\101\114\097\114\109"then return r(p.Character,"\076\101\102\116\076\111\119\101\114\065\114\109")elseif B=="\108\101\102\116\108\111\119\101\114\108\101\103"then return r(p.Character,"\076\101\102\116\076\111\119\101\114\076\101\103")elseif B=="\108\101\102\116\117\112\112\101\114\097\114\109"then return r(p.Character,"\076\101\102\116\085\112\112\101\114\065\114\109")elseif B=="\108\101\102\116\117\112\112\101\114\108\101\103"then return r(p.Character,"\076\101\102\116\085\112\112\101\114\076\101\103")elseif B=="\114\105\103\104\116\102\111\111\116"then return r(p.Character,"\082\105\103\104\116\070\111\111\116")elseif B=="\114\105\103\104\116\104\097\110\100"then return r(p.Character,"\082\105\103\104\116\072\097\110\100")elseif B=="\114\105\103\104\116\108\111\119\101\114\097\114\109"then return r(p.Character,"\082\105\103\104\116\076\111\119\101\114\065\114\109")elseif B=="\114\105\103\104\116\108\111\119\101\114\108\101\103"then return r(p.Character,"\082\105\103\104\116\076\111\119\101\114\076\101\103")elseif B=="\114\105\103\104\116\117\112\112\101\114\097\114\109"then return r(p.Character,"\082\105\103\104\116\085\112\112\101\114\065\114\109")elseif B=="\114\105\103\104\116\117\112\112\101\114\108\101\103"then return r(p.Character,"\082\105\103\104\116\085\112\112\101\114\076\101\103")elseif B=="\114\111\111\116"then return r(r(p.Character,"\076\111\119\101\114\084\111\114\115\111"),"\082\111\111\116")elseif B=="\119\097\105\115\116"then return r(r(p.Character,"\085\112\112\101\114\084\111\114\115\111"),"\087\097\105\115\116")elseif B=="\110\101\099\107"then return r(r(p.Character,"\072\101\097\100"),"\078\101\099\107")elseif B=="\108\101\102\116\097\110\107\108\101"then return r(r(p.Character,"\076\101\102\116\070\111\111\116"),"\076\101\102\116\065\110\107\108\101")elseif B=="\108\101\102\116\119\114\105\115\116"then return r(r(p.Character,"\076\101\102\116\072\097\110\100"),"\076\101\102\116\087\114\105\115\116")elseif B=="\108\101\102\116\101\108\098\111\119"then return r(r(p.Character,"\076\101\102\116\076\111\119\101\114\065\114\109"),"\076\101\102\116\069\108\098\111\119")elseif B=="\108\101\102\116\107\110\101\101"then return r(r(p.Character,"\076\101\102\116\076\111\119\101\114\076\101\103"),"\076\101\102\116\075\110\101\101")elseif B=="\108\101\102\116\115\104\111\117\108\100\101\114"then return r(r(p.Character,"\076\101\102\116\085\112\112\101\114\065\114\109"),"\076\101\102\116\083\104\111\117\108\100\101\114")elseif B=="\108\101\102\116\104\105\112"then return r(r(p.Character,"\076\101\102\116\085\112\112\101\114\076\101\103"),"\076\101\102\116\072\105\112")elseif B=="\114\105\103\104\116\097\110\107\108\101"then return r(r(p.Character,"\082\105\103\104\116\070\111\111\116"),"\082\105\103\104\116\065\110\107\108\101")elseif B=="\114\105\103\104\116\119\114\105\115\116"then return r(r(p.Character,"\082\105\103\104\116\072\097\110\100"),"\082\105\103\104\116\087\114\105\115\116")elseif B=="\114\105\103\104\116\101\108\098\111\119"then return r(r(p.Character,"\082\105\103\104\116\076\111\119\101\114\065\114\109"),"\082\105\103\104\116\069\108\098\111\119")elseif B=="\114\105\103\104\116\107\110\101\101"then return r(r(p.Character,"\082\105\103\104\116\076\111\119\101\114\076\101\103"),"\082\105\103\104\116\075\110\101\101")elseif B=="\114\105\103\104\116\115\104\111\117\108\100\101\114"then return r(r(p.Character,"\082\105\103\104\116\085\112\112\101\114\065\114\109"),"\082\105\103\104\116\083\104\111\117\108\100\101\114")elseif B=="\114\105\103\104\116\104\105\112"then return r(r(p.Character,"\082\105\103\104\116\085\112\112\101\114\076\101\103"),"\082\105\103\104\116\072\105\112")elseif B=="\112\108\097\121\101\114\103\117\105"then return p:WaitForChild("\080\108\097\121\101\114\071\117\105")elseif B=="\115\116\097\114\116\101\114\112\108\097\121\101\114"then return p:WaitForChild("\083\116\097\114\116\101\114\080\108\097\121\101\114")elseif B=="\109\111\117\115\101"then return p:GetMouse()elseif B=="\099\097\109\101\114\097"then return game.Workspace.CurrentCamera elseif B=="\110\097\109\101"then return p.Name end end
--- Alternative to WaitForChild which doesn't error and has custom wait time
local function WaitFor(parent, index) --- funny
	if not parent then
		return _L.Print("Failed to grab " .. index .. " (" .. parent.Name .. " is nil)", true)
	end
	local _t = tick()
	while (tick() - _t) <= waitTimeout do
		local child = parent:FindFirstChild(index)
		if child then
			return child
		end
		_L.Services.RunService.Heartbeat:Wait()
	end
	return _L.Print("Failed to grab " .. index, true)
end

Player.Get = function(instance, player)
	if isClient then
		player = player or game.Players.LocalPlayer
	end
	player = (type(player) == "string" and game.Players:FindFirstChild(player) or player)
	instance = instance or "Player"
	instance = string.lower(instance)

	--- Wait for player + character to EXIST!
	local _t = tick()
	while player and not player.Character and (tick() - _t < waitTimeout) do
		_L.Services.RunService.Stepped:Wait()
	end
	if (not player) or (tick() - _t) >= waitTimeout then
		return
	end

	--- Get humanoid & rigtype
	local humanoid = player.Character:FindFirstChild("Humanoid")
	local rigType = defaultRigType --- this will be default if humanoid cannot be read
	if humanoid then
		rigType = humanoid.RigType
	end

	--- R6 Compatibility
	if rigType == Enum.HumanoidRigType.R6 then
		if instance == "torso" then
			return WaitFor(player.Character, "Torso")
		elseif instance == "leftarm" then
			return WaitFor(player.Character, "LeftArm")
		elseif instance == "leftleg" then
			return WaitFor(player.Character, "LeftLeg")
		elseif instance == "rightarm" then
			return WaitFor(player.Character, "RightArm")
		elseif instance == "rightleg" then
			return WaitFor(player.Character, "RightLeg")
		end
	end

	--- R15 + everything else
	if instance == "player" or not instance then
		return player
	elseif instance == "character" then
		return player.Character
	elseif instance == "head" then
		return WaitFor(player.Character, "Head")
	elseif instance == "torso" or instance == "uppertorso" then
		return WaitFor(player.Character, "UpperTorso")
	elseif instance == "rootpart" or instance == "humanoidrootpart" then
		return WaitFor(player.Character, "HumanoidRootPart")
	elseif instance == "humanoid" then
		return WaitFor(player.Character, "Humanoid")
	elseif instance == "lowertorso" then
		return WaitFor(player.Character, "LowerTorso")
	elseif instance == "leftfoot" then
		return WaitFor(player.Character, "LeftFoot")
	elseif instance == "lefthand" then
		return WaitFor(player.Character, "LeftHand")
	elseif instance == "leftlowerarm" then
		return WaitFor(player.Character, "LeftLowerArm")
	elseif instance == "leftlowerleg" then
		return WaitFor(player.Character, "LeftLowerLeg")
	elseif instance == "leftupperarm" then
		return WaitFor(player.Character, "LeftUpperArm")
	elseif instance == "leftupperleg" then
		return WaitFor(player.Character, "LeftUpperLeg")
	elseif instance == "rightfoot" then
		return WaitFor(player.Character, "RightFoot")
	elseif instance == "righthand" then
		return WaitFor(player.Character, "RightHand")
	elseif instance == "rightlowerarm" then
		return WaitFor(player.Character, "RightLowerArm")
	elseif instance == "rightlowerleg" then
		return WaitFor(player.Character, "RightLowerLeg")
	elseif instance == "rightupperarm" then
		return WaitFor(player.Character, "RightUpperArm")
	elseif instance == "rightupperleg" then
		return WaitFor(player.Character, "RightUpperLeg")
	elseif instance == "root" then
		return WaitFor(WaitFor(player.Character, "LowerTorso"), "Root")
	elseif instance == "waist" then
		return WaitFor(WaitFor(player.Character, "UpperTorso"), "Waist")
	elseif instance == "neck" then
		return WaitFor(WaitFor(player.Character, "Head"), "Neck")
	elseif instance == "leftankle" then
		return WaitFor(WaitFor(player.Character, "LeftFoot"), "LeftAnkle")
	elseif instance == "leftwrist" then
		return WaitFor(WaitFor(player.Character, "LeftHand"), "LeftWrist")
	elseif instance == "leftelbow" then
		return WaitFor(WaitFor(player.Character, "LeftLowerArm"), "LeftElbow")
	elseif instance == "leftknee" then
		return WaitFor(WaitFor(player.Character, "LeftLowerLeg"), "LeftKnee")
	elseif instance == "leftshoulder" then
		return WaitFor(WaitFor(player.Character, "LeftUpperArm"), "LeftShoulder")
	elseif instance == "lefthip" then
		return WaitFor(WaitFor(player.Character, "LeftUpperLeg"), "LeftHip")
	elseif instance == "rightankle" then
		return WaitFor(WaitFor(player.Character, "RightFoot"), "RightAnkle")
	elseif instance == "rightwrist" then
		return WaitFor(WaitFor(player.Character, "RightHand"), "RightWrist")
	elseif instance == "rightelbow" then
		return WaitFor(WaitFor(player.Character, "RightLowerArm"), "RightElbow")
	elseif instance == "rightknee" then
		return WaitFor(WaitFor(player.Character, "RightLowerLeg"), "RightKnee")
	elseif instance == "rightshoulder" then
		return WaitFor(WaitFor(player.Character, "RightUpperArm"), "RightShoulder")
	elseif instance == "righthip" then
		return WaitFor(WaitFor(player.Character, "RightUpperLeg"), "RightHip")
	elseif instance == "playergui" then
		return player:WaitForChild("PlayerGui")
	elseif instance == "starterplayer" then
		return player:WaitForChild("StarterPlayer")
	elseif instance == "mouse" then
		return player:GetMouse()
	elseif instance == "camera" then
		return game.Workspace.CurrentCamera
	elseif instance == "name" then
		return player.Name
	end
end
