Files
md-drugs/client/mescaline.lua
T

41 lines
1.5 KiB
Lua
Raw Normal View History

2025-08-06 02:25:06 -06:00
local locations = ps.callback('md-drugs:server:GetMescalineLocs')
for k, v in pairs (locations.DryOutMescaline) do
2025-07-17 02:06:17 -05:00
ps.boxTarget('dryoutMesc'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{
2025-08-09 03:10:00 -06:00
label = ps.lang('mesc.targetDry'),
2025-07-17 02:06:17 -05:00
icon = 'fa-solid fa-temperature-high',
action = function()
2025-08-09 23:58:38 -06:00
if not ps.hasItem('cactusbulb') then
ps.notify(ps.lang('Catches.itemNeeded', ps.getLabel('cactusbulb')), 'error')
return
end
2025-08-09 03:10:00 -06:00
if not ps.progressbar(ps.lang('mescaline.dry'), 4000, 'uncuff') 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
2025-07-17 02:06:17 -05:00
if not ps.progressbar(ps.lang('mescaline.eat'), 4000, 'uncuff') then return end
2024-05-02 18:34:14 -07:00
if chance <= Config.Badtrip then
AlienEffect()
2024-10-23 17:44:46 -07:00
local clone = ClonePed(PlayerPedId(), false, false, 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)