Next, you type the function or code like this,
Type under Wait(0).
local X, Y, Z = PlayerGetPosXYZ()
if PedMePlaying(gPlayer, "Default_KEY") and IsButtonPressed(7,0) and not PlayerIsInAnyVehicle() then
GameSetPedStat(gPlayer, 20, 200)
Lightning = EffectCreate("ElectrocuteLRG", X, Y, Z + 0.2)
Note :
- local X, Y, Z = PlayerGetPosXYZ()
functions to give the Player a position where the Player is
- if PedMePlaying (gPlayer, "Default_KEY")
functions so that this mod is only active when the Player is standing upright
- if IsButtonPressed (7,0)
function how to activate the mod, (7,0) is Sprint, to know more about the Code Button you can see it here :
https://bullylua.neocities.org/legacy/script/controls.htmlnot PlayerIsInAnyVehicle()
functions to check the Player's condition whether the Player is not in a vehicle, and also functions so that this mod is not active while in a vehicle
- GameSetPedStat(gPlayer, 20, 200)
functions to change the speed of the Player
- Lightning = EffectCreate ("ElectrocuteLRG", X, Y, Z + 0.2)
functions to spawn the Effect where the Player is.
"ElectrocuteLRG" is the Effect model that will be spawned,
here I added Z + 0.2 to change the height of the Spawn Effect