[Help][ESX]esx_drugs/effects

Hey Guys,

first of all thanks for everyone sharing his stuff so we don’T have all to start from scratch.
I recently got into coding lua scripts and this will be my first Request so be easy on me =)
At the moment I’m working on spicing up drug effects. I learned from the esx_drugeffects that we have different scenes SetTimecycleModifier(“spectator3”) which we can alter with SetTimecycleModifierStrength(multiplier) to increase the effect.
I experimenteda lot with values but just see the Docu in my code below.
What I hope you can help me with is the following:
I experienced some very good effects while pressing weapon wheel while my effects were running.
And I noticed Weather “Halloween” also combines with the effects.
Do you guys know how i can add the visual effect of the weapon wheel or do you know some other effects which you can combine.

Another Question i have is how this will affect the server performance if i decide to run calculations for being high like 2-3 hours :smiley:

If you guys wanne see for yourself just try it out

	--[[ I know this is quite ugly but listen here:
	This is made to simulate a trip and can be managed by different phases:
	increastime: every 'Tick' will take 1 second * increasetime value
	increasephase: here it gets a bit complicated:
	This Method SetTimecycleModifierStrength(multiplier) affects the  intensity of our Effect
	Since we want a "realistic" increase of an Effect we want to to start at a value of 0.1 which you wont really notice. 
	We want to increase that modifier to for example to 1.5 since the optimal range is 0.1 to 1.5ish,
	you can experiment yourself there are some insane effects on ridicioules high numbers
	To calculate the multiplier i recommend using this:
	
	https://www.calculat.org/de/potenzen-wurzeln/n-wurzel.html
	
	n = Is the number of loops each phase runs in this case it is 25 for every phase (except phase 4)
	m = is always 1 just deal with it
	x = is how much we want to increase our start value, so in this case I start at 0.1 and want to reach 0.5 which is an increase of 5 
	
	If you hit "Rechne aus" now you will see our multiplier for this phase is 1.066449422
	Honors to my good friend Markus who epxplained me this
	
	
	in this way you can calculate each phase so we reach a specific multiplier. 
	In my oppinion a range from 0.0 to 1.6 as a maximum high is the best experience
	But there are of course endless possibilities 
	
	SetTimecycleModifier("spectator3")	as far as i know we have spectator1 to spectator10 available let me know if you know more
	
	WTF are you doing with the HALLOWEEN weather ?!?
	I saw some ways to combine some effects and boy they are great. 
	HALLOWEEN effects is one of those i like it a lot =)
	WeaponWheel can be pretty cool too when you go crazy with your multiplier values like 5000 but i found no way to trigger it, hit me up if you know how plz 
	
	
	]]

    local player = PlayerId()
	local multiplier = 0.1
	local increasephase1 = 1.06649
	local increasetime1 = 2
	local increasephase2 = 1.01635
	local increasetime2 = 2
	local increasephase3 = 1.01425
	local increasetime3 = 2
	local increasephase4 = 1.01048
	local increasetime4 = 2
	local increasephase5 = 1.01248
	local increasetime5 = 3
	local increasephase6 = 0.8
	local increasetime6 = 10
	local maximumhigh = 200
	local highprogress = 0	
	   
	   SetWeatherTypePersist("HALLOWEEN")
    	SetWeatherTypeNowPersist("HALLOWEEN")
		SetWeatherTypeOvertimePersist("HALLOWEEN", 1000000)
    	SetWeatherTypeNow("HALLOWEEN")
    	SetOverrideWeather("HALLOWEEN")
		
    
	   while highprogress ~= maximumhigh do
	  
		SetTimecycleModifier("spectator3")	
		if highprogress < 25 then			
		SetTimecycleModifierStrength(multiplier)
		multiplier = multiplier * increasephase1
		Citizen.Wait(1000 * increasetime1)
		
		
		elseif highprogress < 50 then
		SetTimecycleModifierStrength(multiplier)
		multiplier = multiplier * increasephase2
		Citizen.Wait(1000 * increasetime2)
		
		
		elseif highprogress < 75 then
		SetTimecycleModifierStrength(multiplier)
		multiplier = multiplier * increasephase3
		Citizen.Wait(1000 * increasetime3)
		
		
		elseif highprogress < 100 then
		SetTimecycleModifierStrength(multiplier)
		multiplier = multiplier * increasephase4
		Citizen.Wait(1000 * increasetime4)
		
		
		elseif highprogress < 150 then
		SetTimecycleModifier("spectator5")	
		SetTimecycleModifierStrength(1.4)
		Citizen.Wait(1000 * increasetime5)		
			
		
		elseif highprogress < 199 then	
		SetTimecycleModifierStrength(multiplier)
		multiplier = multiplier * increasephase6
		
		Citizen.Wait(1000 * increasetime6)
		end
		
		highprogress = highprogress + 1
		  print('Tick: ' .. highprogress .. ' Multiplier: ' .. multiplier)
		
	  end
	  highprogress = 0
      SetRunSprintMultiplierForPlayer(player, 1.0)
      ResetPlayerStamina(player)
      ClearTimecycleModifier()
	  
                        ClearWeatherTypePersist()
  end
end)

How to use?

canu send me the script?

if i remember correctly, you can copy the code above in one of esx_drugeffects effects.