“Players.mw3ak471230.PlayerScripts.CoreClient:58: attempt to index nil with ‘Deactivate’ - Players.mw3ak471230.PlayerScripts.CoreClient, line 58 - function GetHumanoid
Players.mw3ak471230.PlayerScripts.CoreClient, line 165”
local function GetHumanoid(char)
if char then
Services.DynamicArms.Deactivate()
Services.InteractController.Init()
Services.Verificator.Init()
humanoid = char:WaitForChild("Humanoid")
Services.MovementController.OnDeath()
Services.MovementController.InitHumanoid(humanoid)
SetupDefaults(humanoid)
Services.JusticeController.InitHumanoid(humanoid)
Services.KeyBinder.InitHumanoid(humanoid)
Services.InventoryController.InitHumanoid(humanoid)
Services.VehicleController.InitHumanoid(humanoid, playerGui)
Services.Minimap.InitHumanoid(humanoid)
Services.BankController.InitHumanoid(humanoid)
Services.ClientFunctions.InitHumanoid(humanoid)
Services.RadioController.Init(playerGui, humanoid)
--Services.JusticeController.CheckJail(humanoid, playerGui)
Services.ToolHandler.Init(humanoid)
Services.DynamicArms.Init(humanoid)
if not loaded then
loaded = true
do
local cmdr = require(ReplicatedStorage:WaitForChild("Resources").Libraries:WaitForChild("CmdrClient"))
local roles = Services.Verificator.GetPlayerRoles()
cmdr:SetEnabled(roles.Moderator or roles.Admin or false)
cmdr:SetActivationKeys({
Enum.KeyCode.Semicolon
})
screen:End()
local hotkeyEnabled = false
local currentState = true
local hideNames = false
local lastHit = tick()
local Assets = require(ReplicatedStorage.Databases.Assets)
local chars = {}
local function PlayerAdded(argPlayer)
local function CharAdded(argChar)
local hum = argChar:WaitForChild("Humanoid")
hum.DisplayDistanceType = not (not currentState and hideNames) and Enum.HumanoidDisplayDistanceType.Viewer or Enum.HumanoidDisplayDistanceType.None
chars[argPlayer] = hum
end
argPlayer.CharacterAdded:Connect(CharAdded)
if argPlayer.Character then
CharAdded(argPlayer.Character)
end
end
Players.PlayerAdded:Connect(PlayerAdded)
Players.PlayerRemoving:Connect(function(plr)
chars[plr] = nil
end)
for _, v in pairs(Players:GetPlayers()) do
PlayerAdded(v)
end
local guis = {}
local function ChildAdded(child)
if child:IsA("LayerCollector") then
guis[child] = true
child.Enabled = currentState
end
end
playerGui.ChildAdded:Connect(ChildAdded)
playerGui.ChildRemoved:Connect(function(child)
guis[child] = nil
end)
for _, v in pairs(playerGui:GetChildren()) do
ChildAdded(v)
end
UserInputService.InputBegan:Connect(function(inputObject, processed)
if processed or not hotkeyEnabled then
return
end
if inputObject.KeyCode == Enum.KeyCode.Backquote then
local thisHit = tick()
if thisHit - lastHit <= 0.5 then
currentState = not currentState
local ctrlDown = UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) or UserInputService:IsKeyDown(Enum.KeyCode.RightControl)
local shiftDown = UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) or UserInputService:IsKeyDown(Enum.KeyCode.RightShift)
for gui, _ in pairs(guis) do
gui.Enabled = currentState
end
if player.Character then
for _, v in pairs(player.Character:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("Decal") then
v.LocalTransparencyModifier = not (not currentState and ctrlDown) and 0 or 1
end
end
end
mouse.Icon = currentState and "" or Assets.Blank
hideNames = shiftDown
for _, v in pairs(chars) do
v.DisplayDistanceType = not (not currentState and hideNames) and Enum.HumanoidDisplayDistanceType.Viewer or Enum.HumanoidDisplayDistanceType.None
end
end
lastHit = tick()
end
end)
local function CheckHideGuis()
local roles = Services.Verificator.GetPlayerRoles()
hotkeyEnabled = roles.PBSTeam
end
CheckHideGuis()
Services.Verificator.OnVerifyUpdate:Connect(CheckHideGuis)
end
end
end
end
wait(0.5)
GetHumanoid(player.Character)
player.CharacterAdded:Connect(GetHumanoid)