Useful LUA Scripts

Posts 1–15 of 36 · Page 1 of 3
Useful LUA Scripts
This a compilation of the known scripts and if you want to use them in the game just copy paste what ever script you want into a Notepad document then save it as script.lua (Make sure file extention is .lua or it will just be a regular .txt). Copy your script.lua into your Payday 2 directory along with the iphlpapia.dll file. Run the game and press Insert in-game and your hacks will load. It's as simple as that.

Message Display

Code:
if managers.hud then
   managers.hud:show_hint( { text = "Put message here." } )
end
Infinite Cable Ties

Code:
if not _rmSpecial then
   _rmSpecial = PlayerManager.remove_special
end
function PlayerManager:remove_special( name ) end
Infinite Equipment

Code:
function PlayerManager:remove_equipment_possession( peer_id, equipment ) end
 
PlayerStandard._get_walk_headbob = function(self) return 0 end
PlayerStandard._can_stand = function(self) return true end
PlayerManager.remove_equipment = function(self, equipment_id) end
PlayerManager.selected_equipment_deploy_timer = function(self) return 0 end
PlayerManager.chk_minion_limit_reached = function(self) return false end
PlayerManager.spread_multiplier = function(self) return 0 end
PlayerMovement.is_stamina_drained = function(self) return false end
PlayerStandard._can_run_directional = function(self) return true end
 
BaseInteractionExt._has_required_upgrade = function(self) return true end
BaseInteractionExt._has_required_deployable = function(self) return true end
BaseInteractionExt._get_timer = function(self) return 0 end
BaseInteractionExt.can_interact = function(self, player) return true end
Infinite Saw

Code:
if not _fireSaw then
   _fireSaw = SawWeaponBase.fire
end
function SawWeaponBase:fire( from_pos, direction, dmg_mul, shoot_player, spread_mul, autohit_mul, suppr_mul, target_unit )
   _fireSaw( self, from_pos, direction, dmg_mul, shoot_player, spread_mul, autohit_mul, suppr_mul, target_unit )
 
   if managers.player:player_unit() == self._setup.user_unit then
      self.set_ammo(self, 1.0)
   end
end
Infinite Ammo Clip

Code:
if not _fireWep then
   _fireWep = NewRaycastWeaponBase.fire
end
function NewRaycastWeaponBase:fire( from_pos, direction, dmg_mul, shoot_player, spread_mul, autohit_mul, suppr_mul, target_unit )
   _fireWep( self, from_pos, direction, dmg_mul, shoot_player, spread_mul, autohit_mul, suppr_mul, target_unit )
   
   if managers.player:player_unit() == self._setup.user_unit then
      self.set_ammo(self, 1.0)
   end
end
Throwing Distance

Code:
QUOTE]local car_arr = {
        'being',
        'mega_heavy',
        'heavy',
        'medium',
        'light',
        'coke_light'
}
 
for i, name in ipairs(car_arr) do
        tweak_data.carry.types[ name ].throw_distance_multiplier = 4.0
end
God Mode

Code:
local player = managers.player:player_unit()
player:character_damage():set_invulnerable( true )
Player Modifications

Code:
PlayerStandard._get_walk_headbob = function(self) return 0 end
PlayerStandard._can_stand = function(self) return true end
PlayerManager.remove_equipment = function(self, equipment_id) end
 
PlayerManager.selected_equipment_deploy_timer = function(self) return 0 end
PlayerManager.chk_minion_limit_reached = function(self) return false end
PlayerManager.spread_multiplier = function(self) return 0 end
PlayerMovement.is_stamina_drained = function(self) return false end
PlayerStandard._can_run_directional = function(self) return true end
Fast Drilling

Code:
function TimerGui:_set_jamming_values() return end
function TimerGui:start( timer )
        timer = 0.01
        if self._jammed then
                self:_set_jammed( false )
                return
        end
       
        if not self._powered then
                self:_set_powered( true )
                return
        end
       
        if self._started then
                return
        end
       
        self:_start( timer )
        if managers.network:session() then
                managers.network:session():send_to_peers_synched( "start_timer_gui", self._unit, timer )
        end
end
No Dead Civilians

Code:
MoneyManager.get_civilian_deduction = function(self) return 0 end
Infinite Sentry Ammo + No Recoil

Code:
function SentryGunWeapon:fire( blanks, expend_ammo )
   local fire_obj = self._effect_align[ self._interleaving_fire ]
   local from_pos = fire_obj:position()
   local direction = fire_obj:rotation():y()
   mvector3.spread( direction, tweak_data.weapon[ self._name_id ].SPREAD * self._spread_mul )
   World:effect_manager():spawn( self._muzzle_effect_table[ self._interleaving_fire ] ) -- , normal = col_ray.normal } )
   if self._use_shell_ejection_effect then
      World:effect_manager():spawn( self._shell_ejection_effect_table )
   end
   local ray_res = self:_fire_raycast( from_pos, direction, blanks )
   if self._alert_events and ray_res.rays then
      RaycastWeaponBase._check_alert( self, ray_res.rays, from_pos, direction, self._unit )
   end
   return ray_res
end
Sentry God Mode

Code:
function SentryGunDamage:damage_bullet( attack_data ) end
Mark All Enemies

Code:
function mark_enemies()
   local units = World:find_units_quick( "all", 3, 16, 21, managers.slot:get_mask( "enemies" ) )
   for i,unit in ipairs( units ) do
      -- Check if we are undetected still
      --if managers.groupai:state():whisper_mode() then
         -- Check if unit is not a civ
         if tweak_data.character[ unit:base()._tweak_table ].silent_priority_shout then
            managers.game_play_central:add_enemy_contour( unit, false )
            managers.network:session():send_to_peers_synched( "mark_enemy", unit, false )
         end
      --end
   end
end
 
if managers.hud then -- Check if in-game, otherwise, GameSetup class isn't prepared yet and code fails
   if not _gameUpdate then _gameUpdate = GameSetup.update end
   do
      local _gameUpdateLastMark
      function GameSetup:update( t, dt )
         _gameUpdate(self, t, dt);
       
         if not _gameUpdateLastMark or t - _gameUpdateLastMark > 9 then
            _gameUpdateLastMark = t
            mark_enemies()
         end
      end
   end
end
Infinite Pagers

Code:
function GroupAIStateBase:on_successful_alarm_pager_bluff() end
Demi-God Mode (2x Health, Armour, Damage)

Code:
if not _upgradeValue then _upgradeValue = PlayerManager.upgrade_value end 
function PlayerManager:upgrade_value( category, upgrade, default ) 
   if category == "player" and upgrade == "health_multiplier" then 
      return 2 
   elseif category == "player" and upgrade == "armor_multiplier" then 
      return 2 
   elseif category == "player" and upgrade == "passive_damage_multiplier" then 
      return 2 
   else 
      return _upgradeValue(self, category, upgrade, default) 
   end 
end 
managers.player:player_unit():character_damage():replenish()
Infinite Stamina

Code:
PlayerMovement.is_stamina_drained = function(self) return false end
No Movement Penalty

Code:
PlayerManager.body_armor_movement_penalty = function(self) return 2 end
No Weapon Spread

Code:
NewRaycastWeaponBase._get_spread = function(self) return 0 end
No Weapon Recoil

Code:
NewRaycastWeaponBase.recoil_multiplier = function(self) return 0 end
Increased Weapon Reload Speed

Code:
NewRaycastWeaponBase.reload_speed_multiplier = function(self) return 2000 end
Increased Weapon Fire Rate

Code:
NewRaycastWeaponBase.fire_rate_multiplier = function(self) return 10 end
Increased Weapon Swap Speed

Code:
PlayerStandard._get_swap_speed_multiplier = function(self) return 2000 end
Allow Interaction With Any Equipment

Code:
BaseInteractionExt._has_required_upgrade = function(self) return true end 
BaseInteractionExt._has_required_deployable = function(self) return true end 
BaseInteractionExt.can_interact = function(self, player) return true end
Instant Interaction

Code:
if not _getTimer then _getTimer = BaseInteractionExt._get_timer end 
function BaseInteractionExt:_get_timer() 
   if self.tweak_data == "corpse_alarm_pager" then 
      return _getTimer(self) 
   end 
   return 0 
end
Instant Deploy

Code:
PlayerManager.selected_equipment_deploy_timer = function(self) return 0 end
Money + Skillpoints + Level

Code:
managers.experience:_set_current_level(50) -- level 
managers.skilltree:_set_points(750) -- skill points 
managers.money:_add_to_total(175000000) -- money
All Weapons Unlocked

Code:
local wep_arr = { 
   'new_m4', 'glock_17', 'mp9', 'r870', 'glock_18c', 'amcar', 'm16', 'olympic', 'ak74', 'akm', 'akmsu', 'saiga', 'ak5', 'aug', 'g36', 'p90', 'new_m14', 'deagle', 'new_mp5', 'colt_1911', 'mac10', 'serbu', 'huntsman', 'b92fs', 'new_raging_bull',  'saw' 
} 
for i, name in ipairs(wep_arr) do 
   if not managers.upgrades:aquired(name) then 
      managers.upgrades:aquire(name) 
   end 
end
All Weapon Mods Unlocked

Code:
for mod_id,_ in pairs(tweak_data.blackmarket.weapon_mods) do 
        tweak_data.blackmarket.weapon_mods[ mod_id ].unlocked = true 
        managers.blackmarket:add_to_inventory("normal", "weapon_mods", mod_id, false) 
end
All Masks Unlocked

Code:
managers.blackmarket:_setup_masks() 
for mask_id,_ in pairs(tweak_data.blackmarket.masks) do 
        Global.blackmarket_manager.masks[mask_id].unlocked = true 
        managers.blackmarket:add_to_inventory("normal", "masks", mask_id, false) 
end
No Alarm + Security Camera Alerts

Code:
function GroupAIStateBase:_clbk_switch_enemies_to_not_cool() end 
function PlayerMovement:on_suspicion( observer_unit, status ) end 
function GroupAIStateBase:on_criminal_suspicion_progress( u_suspect, u_observer, status ) end 
function GroupAIStateBase:criminal_spotted( unit ) end 
function GroupAIStateBase:report_aggression( unit ) end 
function PlayerMovement:on_uncovered( enemy_unit ) end 
function CopMovement:anim_clbk_police_called( unit ) end 
function CopLogicArrest._upd_enemy_detection( data ) end 
function CopLogicArrest._call_the_police( data, my_data, paniced ) end 
function CopLogicIdle.on_alert( data, alert_data ) end 
function CopLogicBase._get_logic_state_from_reaction( data, reaction ) 
   return "idle" 
end 
function GroupAIStateBase:sync_event( event_id, blame_id ) end 
function GroupAIStateBase:on_police_called( called_reason ) end 
function GroupAIStateBase:on_police_weapons_hot( called_reason ) end 
function GroupAIStateBase:on_gangster_weapons_hot( called_reason ) end 
function GroupAIStateBase:on_enemy_weapons_hot( is_delayed_callback ) end 
function GroupAIStateBase:_clbk_switch_enemies_to_not_cool() end 
if not _setWhisper then _setWhisper = GroupAIStateBase.set_whisper_mode end 
function GroupAIStateBase:set_whisper_mode( enabled ) _setWhisper(self, true) end 
function CivilianBrain:on_cool_state_changed( state ) end 
function CivilianLogicSurrender._do_initial_act( data, amount, aggressor_unit, initial_act ) end 
function CopMovement:set_stance( new_stance_name ) end 
function CopMovement:set_stance_by_code( new_stance_code ) end 
function HuskPlayerMovement:_upd_stance( t ) end 
function HuskPlayerMovement:_change_stance( stance_code, delayed_shot ) end 
function CivilianLogicFlee._upd_detection( data ) end 
function CivilianLogicFlee.on_alert( data, alert_data ) end 
function CivilianLogicFlee._run_away_from_alert( data, alert_data ) end 
function CivilianLogicFlee.post_react_alert_clbk( shait, params ) end 
function CivilianLogicFlee.on_intimidated( data, amount, aggressor_unit ) end 
function CivilianLogicFlee._find_hide_cover( data ) end 
function CivilianLogicFlee._start_moving_to_cover( data, my_data ) end 
function CivilianLogicFlee.clbk_chk_call_the_police( ignore_this, data ) end 
function CopMovement:set_cool( state, giveaway ) end 
function CopLogicBase.add_delayed_clbk( internal_data, id, clbk, exec_t ) end 
function CopMovement:set_allow_fire( state ) end 
function CopMovement:on_suppressed( state ) end 
function SecurityCamera:_upd_suspicion( t ) end 
function SecurityCamera:_sound_the_alarm( detected_unit ) end 
function SecurityCamera:_set_suspicion_sound( suspicion_level ) end 
function SecurityCamera:clbk_call_the_police() end 
function CopMovement:set_attention( attention ) end 
if not _actionRequest then _actionRequest = CopMovement.action_request end 
function CopMovement:action_request( action_desc ) 
   if action_desc.type == "hurt" then 
      _actionRequest(self, action_desc) 
   end 
end
Force Win

Code:
if managers.platform:presence() == "Playing" then 
   local num_winners = managers.network:game():amount_of_alive_players() 
   managers.network:session():send_to_peers( "mission_ended", true, num_winners ) 
   game_state_machine:change_state_by_name( "victoryscreen", { num_winners = num_winners, personal_win = true } ) 
end
Force Loss

Code:
if managers.platform:presence() == "Playing" then 
   managers.network:session():send_to_peers( "mission_ended", false, 0 ) 
   game_state_machine:change_state_by_name( "gameoverscreen" ) 
end
the allow interaction with anything crashes me when i try to use any other equipments
Quote Originally Posted by A15JWG View Post
the allow interaction with anything crashes me when i try to use any other equipments
Okay I will have a look at that one. Just don't use it for now.
Is there a specific weapon mod unlock script?
Quote Originally Posted by Yakuzaku View Post
Is there a specific weapon mod unlock script?
I'm not too sure about that. I don't think there is. The script for this one pretty much just unlocks everything and gives you 2 of each attachment.
I've been looking around, but without much success. Is there a LUA script for adding Mask Colors/Patterns/Materials? Not the actual masks themselves, I'm aware that script is floating around everywhere.
Quote Originally Posted by OTC View Post
I've been looking around, but without much success. Is there a LUA script for adding Mask Colors/Patterns/Materials? Not the actual masks themselves, I'm aware that script is floating around everywhere.
I think the one used in the Moon Trainer unlocks everything for the masks.
what does the no alarm do? does it mean that i can run around and if a guard sees me he still wont set of the alarm?
Quote Originally Posted by OTC View Post
I've been looking around, but without much success. Is there a LUA script for adding Mask Colors/Patterns/Materials? Not the actual masks themselves, I'm aware that script is floating around everywhere.
Try these scripts of mine on for size, they're better than the existing "unlock everything" script that everyone uses.
Quote Originally Posted by doodoo21 View Post
what does the no alarm do? does it mean that i can run around and if a guard sees me he still wont set of the alarm?
It basically stops you from triggering any kind of alarms and allows you to stealth through the whole mission.
Quote Originally Posted by youawindowshopper View Post
Try these scripts of mine on for size, they're better than the existing "unlock everything" script that everyone uses.
Thanks alot, this is exactly what I'm looking for. Haven't had a chance to test yet, but appreciate the effort regardless. Cheers.
Guys, Infinite Pagers NOT WORKING
i heard all weapon mods gives you an unremovable (!) from inventory? Also how does this method differ from the normal payday card choosing, when do I activate it? (if it won't look legit if OK Scans us or w/e) I won't use it, probably the only script I'll use because I don't wanna buy the game again.
Giving some credits to me (TranscendPerfection at CE Forums) would be nice since all except 1 of these scripts is taken directly from my post.
Posts 1–15 of 36 · Page 1 of 3
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us