Files
md-drugs/client/mescaline.lua
T

54 lines
1.8 KiB
Lua
Raw Normal View History

2026-01-16 02:57:26 -07:00
local badTrip = 100
2026-01-19 00:38:01 -07:00
local locations = GlobalState.MDDrugsLocations.Mescaline
2025-09-05 21:28:04 -07:00
local function AlienEffect()
2026-01-16 02:57:26 -07:00
CreateThread(function()
2025-09-05 21:28:04 -07:00
StartScreenEffect("DrugsMichaelAliensFightIn", 3.0, 0)
StartScreenEffect("DrugsMichaelAliensFight", 3.0, 0)
2026-01-16 02:57:26 -07:00
Wait(math.random(25000, 35000))
2025-09-05 21:28:04 -07:00
StartScreenEffect("DrugsMichaelAliensFightOut", 3.0, 0)
StopScreenEffect("DrugsMichaelAliensFightIn")
StopScreenEffect("DrugsMichaelAliensFight")
StopScreenEffect("DrugsMichaelAliensFightOut")
2026-01-16 02:57:26 -07:00
end)
2025-09-05 21:28:04 -07:00
end
2026-01-19 00:38:01 -07:00
2025-08-06 02:25:06 -06:00
for k, v in pairs (locations.DryOutMescaline) do
2026-01-16 02:57:26 -07:00
Bridge.Target.AddBoxZone('dryoutMesc'..k, v.loc, vector3(v.l, v.w, 2.0), v.loc.w or 180.0,{
2025-07-17 02:06:17 -05:00
{
2026-01-16 02:57:26 -07:00
label = Bridge.Language.Locale('mesc.targetDry'),
2025-07-17 02:06:17 -05:00
icon = 'fa-solid fa-temperature-high',
action = function()
2026-01-21 22:02:25 -07:00
if not itemCheck('cactusbulb') then return end
2026-01-23 03:41:19 -07:00
if not progressbar(Bridge.Language.Locale('mesc.dry')) then return end
2025-07-17 02:06:17 -05:00
TriggerServerEvent("md-drugs:server:drymescaline", k)
end,
canInteract = function()
if not handleGang(v.gang) then return false end
return true
end
}
})
end
2024-01-13 22:23:17 -08:00
2024-05-02 18:34:14 -07:00
RegisterNetEvent("md-drugs:client:takemescaline", function()
local chance, chance2 = math.random(1,100), math.random(1,100)
local weapon = ''
if chance2 == 100 then weapon = 'weapon_rpg' else weapon = 'weapon_flaregun' end
2026-01-23 03:41:19 -07:00
if not progressbar(Bridge.Language.Locale('mesc.eat')) then return end
2026-01-16 02:57:26 -07:00
if chance <= badTrip then
2024-05-02 18:34:14 -07:00
AlienEffect()
2026-01-16 02:57:26 -07:00
Wait(math.random(3000,6000))
local clone = ClonePed(PlayerPedId(), true, true, true)
2024-05-02 18:34:14 -07:00
SetEntityAsMissionEntity(clone)
SetPedFleeAttributes(clone, false)
GiveWeaponToPed(clone, weapon, 1, false, true)
TaskCombatPed(clone, PlayerPedId(), 0, 16)
SetPedCombatAttributes(clone, 46, true)
Wait(1000 * 30)
DeleteEntity(clone)
2024-05-02 18:34:14 -07:00
else
AlienEffect()
end
2024-01-13 22:23:17 -08:00
end)