0% found this document useful (0 votes)
17 views2 pages

Menu

This document contains Lua code for a menu script. It defines functions to drop a random ped near the player and set the player's health to 0, as well as toggle whether the player's max health is set to a low value to appear as an undead player off the radar.

Uploaded by

smokeyfrogfr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Menu

This document contains Lua code for a menu script. It defines functions to drop a random ped near the player and set the player's health to 0, as well as toggle whether the player's max health is set to a low value to appear as an undead player off the radar.

Uploaded by

smokeyfrogfr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

local function PedDrop()

local position = localplayer:get_position()


position.z = position.z + 30

for p in replayinterface.get_peds() do
if p == nil or p == localplayer then
goto continue
end

if p:get_pedtype() < 4 then


goto continue
end

if p:is_in_vehicle() then
goto continue
end

p:set_position(position)

if p:get_health() > 99 then


p:set_position(position)
p:set_freeze_momentum(true)
p:set_health(0)
p:set_wallet(1337)
break
end

::continue::
end
end

-- Uncomment the next line to drop a ped when pressing F3


-- menu.register_hotkey(114, PedDrop)

-- Add Menu action under scripts sub menu


menu.add_action("Drop Ped", PedDrop)

local original_max_health = 0.0

local function GetUndeadOffradar()


if localplayer == nil then
return nil
end

max_health = localplayer:get_max_health()
return max_health < 100.0
end

local function SetUndeadOffradar(value)


if value == nil or localplayer == nil then
return
end

if value then
max_health = localplayer:get_max_health()
if max_health >= 100.0 then
original_max_health = max_health
end
localplayer:set_max_health(0.0)
else
if original_max_health >= 100 then
localplayer:set_max_health(original_max_health)
else
localplayer:set_max_health(328.0)
end
end
end

menu.add_toggle("Undead offradar", GetUndeadOffradar, SetUndeadOffradar)

local function ToggleUndeadOffradar()


value = GetUndeadOffradar()
if value ~= nil then
SetUndeadOffradar(not value)
end
end

-- Uncomment the next line to toggle undead offradar when pressing F4


-- menu.register_hotkey(115, ToggleUndeadOffradar)

You might also like