For the same script as the Voice Chat, I want to disable HUD and Crosshair. This is the Code:
[lua] function AntiRandomatNoHUD()
AntiRandomatBroadcast("AntiRandomat: ", Color(255,255,255), “Mal gucken, wie ihr ohne HUD zurecht kommt!”)
for k, v in pairs(player.GetAll()) do
if v:IsPlayer then
v:CrosshairDisable
local hide = {
CHudHealth = true,
CHudBattery = true,
}
end
hook.Add( “HUDShouldDraw”, “HideHUD”, function( AwayWithIt )
if ( hide[ AwayWithIt ] ) then return false end
end)
timer.Simple(480, function()
for k, v in pairs(self:GetAlivePlayers()) do
v:CrosshairEnable
hook.Remove( “HUDShouldDraw”, “HideHUD” )
end)
end
end
end[/lua]
But it seems that this is not working. I don´t know what I am doing wrong. I don´t the Errors right now, because I closed the Console, but maybe you can find my mistake with this Intel.
Thanks for help.