Kaperoos Posted February 11, 2019 Share Posted February 11, 2019 after running the script on effects when I enter the command, nothing happens Quote --There are 82 effects local effectNames = { "blood_heli","boat_prop","camflash","carwashspray","cement","cloudfast","coke_puff","coke_trail","cigarette_smoke", "explosion_barrel","explosion_crate","explosion_door","exhale","explosion_fuel_car","explosion_large","explosion_medium", "explosion_molotov","explosion_small","explosion_tiny","extinguisher","flame","fire","fire_med","fire_large","flamethrower", "fire_bike","fire_car","gunflash","gunsmoke","insects","heli_dust","jetpack","jetthrust","nitro","molotov_flame", "overheat_car","overheat_car_electric","prt_blood","prt_boatsplash","prt_bubble","prt_cardebris","prt_collisionsmoke", "prt_glass","prt_gunshell","prt_sand","prt_sand2","prt_smokeII_3_expand","prt_smoke_huge","prt_spark","prt_spark_2", "prt_splash","prt_wake","prt_watersplash","prt_wheeldirt","petrolcan","puke","riot_smoke","spraycan","smoke30lit","smoke30m", "smoke50lit","shootlight","smoke_flare","tank_fire","teargas","teargasAD","tree_hit_fir","tree_hit_palm","vent","vent2", "water_hydrant","water_ripples","water_speed","water_splash","water_splash_big","water_splsh_sml","water_swim","waterfall_end", "water_fnt_tme","water_fountain","wallbust","WS_factorysmoke" } addCommandHandler("createEffect", function(_, effectIndex) effectIndex = tonumber(effectIndex) if effectIndex and type(effectIndex) == "number" then if effectIndex > 0 and effectIndex <= #effectNames then createEffect(effectNames[effectIndex], Vector3( getElementPosition( getLocalPlayer() ) ), 0, 0, 0) end end end) --Example Command: /createEffect 3 Link to comment
Z4Zy Posted February 11, 2019 Share Posted February 11, 2019 (edited) Did you run that function on client side and command as for example /createEffect 3 ?? [ createEffect not createeffect , with capital E ? ] Edited February 11, 2019 by DeadthStrock Link to comment
Kaperoos Posted February 11, 2019 Author Share Posted February 11, 2019 5 hours ago, DeadthStrock said: Did you run that function on client side and command as for example /createEffect 3 ?? [ createEffect not createeffect , with capital E ? ] Yes Link to comment
gubi Posted February 12, 2019 Share Posted February 12, 2019 Works for me, show your meta.xml file. Link to comment
Master_11 Posted February 12, 2019 Share Posted February 12, 2019 client.lua local effectNames = { "blood_heli","boat_prop","camflash","carwashspray","cement","cloudfast","coke_puff","coke_trail","cigarette_smoke", "explosion_barrel","explosion_crate","explosion_door","exhale","explosion_fuel_car","explosion_large","explosion_medium", "explosion_molotov","explosion_small","explosion_tiny","extinguisher","flame","fire","fire_med","fire_large","flamethrower", "fire_bike","fire_car","gunflash","gunsmoke","insects","heli_dust","jetpack","jetthrust","nitro","molotov_flame", "overheat_car","overheat_car_electric","prt_blood","prt_boatsplash","prt_bubble","prt_cardebris","prt_collisionsmoke", "prt_glass","prt_gunshell","prt_sand","prt_sand2","prt_smokeII_3_expand","prt_smoke_huge","prt_spark","prt_spark_2", "prt_splash","prt_wake","prt_watersplash","prt_wheeldirt","petrolcan","puke","riot_smoke","spraycan","smoke30lit","smoke30m", "smoke50lit","shootlight","smoke_flare","tank_fire","teargas","teargasAD","tree_hit_fir","tree_hit_palm","vent","vent2", "water_hydrant","water_ripples","water_speed","water_splash","water_splash_big","water_splsh_sml","water_swim","waterfall_end", "water_fnt_tme","water_fountain","wallbust","WS_factorysmoke" } function createEffects(_, effectIndex) local effectIndex = tonumber(effectIndex) if (not effectIndex and (not type(effectIndex) == "number")) then return false end if (effectIndex ~= 0 and effectIndex <= #effectNames) then createEffect(effectNames[effectIndex], Vector3(getElementPosition(getLocalPlayer())), Vector3(getElementRotation(getLocalPlayer()))) end end addCommandHandler("createEffect", createEffects) meta.xml <meta> <script src="client.lua" type="client" /> </meta> Link to comment
Kaperoos Posted February 14, 2019 Author Share Posted February 14, 2019 could you use a name instead of a number? e.g. /effect riot_smoke Link to comment
Moderators Patrick Posted February 14, 2019 Moderators Share Posted February 14, 2019 2 hours ago, Kaperoos said: could you use a name instead of a number? e.g. /effect riot_smoke Yes, but make you sure, you are using correct name. function createEffects(_, effectName) createEffect(effectName, Vector3(getElementPosition(getLocalPlayer())), Vector3(getElementRotation(getLocalPlayer()))) end addCommandHandler("createEffect", createEffects) 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now