Main/resources/[carscripts]/slashtires/bridge/framework/nd/client.lua

20 lines
557 B
Lua
Raw Normal View History

2025-06-07 08:51:21 +02:00
---Checks if the player can slash tires
---@return boolean canPlayerSlash
---@return string|nil reason nil if canPlayerSlash is true
function CanPlayerSlashTires()
local playerState = LocalPlayer.state
if playerState.dead then
return false, 'is_dead'
end
if playerState.gettingCuffed or playerState.isCuffed then
return false, 'is_handcuffed'
end
if playerState.invBusy or playerState.handsUp or playerState.isCuffing then
return false, 'generic_fail_reason'
end
return true
end