daily pastebin goal
70%
SHARE
TWEET

Untitled

PontusB99 May 16th, 2018 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RegisterNetEvent('pee')
  2. AddEventHandler('pee', function()
  3.   local particleDictionary = "scr_amb_chop"
  4.   local particleName = "ent_anim_dog_peeing"
  5.   local animDictionary = 'missbigscore1switch_trevor_piss'
  6.   local animName = 'piss_loop'
  7.  
  8.   RequestNamedPtfxAsset(particleDictionary)
  9.   while not HasNamedPtfxAssetLoaded(particleDictionary) do
  10.      Citizen.Wait(0)
  11.   end
  12.  
  13.   RequestAnimDict(animDictionary)
  14.  
  15.   while not HasAnimDictLoaded(animDictionary) do
  16.     Citizen.Wait(0)
  17.   end
  18.  
  19.   SetPtfxAssetNextCall(particleDictionary)
  20.   bone   = GetPedBoneIndex(GetPlayerPed(-1), 11816)
  21.   TaskPlayAnim(GetPlayerPed(-1), animDictionary, animName, 8.0, -8.0, -1, 0, 0, false, false, false)
  22.   effect = StartParticleFxLoopedOnPedBone(particleName, GetPlayerPed(-1), 0.0, 0.0, -0.1, 90.0, 90.0, 20.0, bone, 2.0, false, false, false);
  23.   Wait(5500)
  24.   StopParticleFxLooped(effect, 0)
  25. end)
  26.  
  27. RegisterNetEvent('poop')
  28. AddEventHandler('poop', function()
  29.   local particleDictionary = "scr_amb_chop"
  30.   local particleName = "ent_anim_dog_poo"
  31.   local animDictionary = 'switch@trevor@on_toilet'
  32.   local animName = 'trev_on_toilet_exit'
  33.  
  34.   RequestNamedPtfxAsset(particleDictionary)
  35.   while not HasNamedPtfxAssetLoaded(particleDictionary) do
  36.      Citizen.Wait(0)
  37.   end
  38.  
  39.   RequestAnimDict(animDictionary)
  40.  
  41.   while not HasAnimDictLoaded(animDictionary) do
  42.     Citizen.Wait(0)
  43.   end
  44.  
  45.   SetPtfxAssetNextCall(particleDictionary)
  46.   bone   = GetPedBoneIndex(GetPlayerPed(-1), 11816)
  47.  
  48.   TaskPlayAnim(GetPlayerPed(-1), animDictionary, animName, 8.0, -8.0, -1, 0, 0, false, false, false)
  49.   effect = StartParticleFxLoopedOnPedBone(particleName, GetPlayerPed(-1), 0.0, -0.9, -0.5, 0.0, 0.0, 20.0, bone, 2.0, false, false, false);
  50.   Wait(2000)
  51.   StopParticleFxLooped(effect, 0)
  52. end)
  53.  
  54. local ESX = nil
  55.  
  56. Citizen.CreateThread(function()
  57.   while ESX == nil do
  58.     TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  59.     Citizen.Wait(0)
  60.   end
  61. end)
  62.  
  63. function openMenu()
  64.   ESX.UI.Menu.CloseAll()
  65.  
  66.   ESX.UI.Menu.Open(
  67.     'default', GetCurrentResourceName(), 'toilet_menu',
  68.     {
  69.       title    = 'Toalett-meny',
  70.       elements = {
  71.         {label = 'Kissa', value = 'pee'},
  72.         {label = 'Bajsa', value = 'poop'}
  73.       }
  74.     },
  75.     function(data, menu)
  76.       if data.current.value == 'pee' then
  77.         TriggerEvent('pee')
  78.       elseif data.current.value == 'poop' then
  79.         TriggerEvent('poop')
  80.       end
  81.     end,
  82.     function(data, menu)
  83.       menu.close()
  84.     end
  85.   )
  86. end
  87.  
  88. Citizen.CreateThread(function()
  89.   while true do
  90.     Wait(10)
  91.     if IsControlJustReleased(0, Keys['E']) then
  92.       openMenu()
  93.     end
  94.   end
  95. end)
RAW Paste Data
Top