Jump to content

Dx Shader smoke to put the fire?


ronaldoguedess

Recommended Posts

Hello Ronaldo,

The code below will create a smoke effect at the player's position.

It only lasts for a couple of seconds but there are plenty of other smoke effects you can choose from that will last until you destroy it.

Check out this list:

https://wiki.multitheftauto.com/wiki/El ... fects_list

https://wiki.multitheftauto.com/wiki/CreateEffect

addEventHandler("onClientResourceStart",root,  
    function() 
        local x, y, z = getElementPosition(localPlayer) 
        local effect = createEffect("riot_smoke",x,y,z) 
    end 
) 

This one will follow the player:

local x,y,z = getElementPosition(localPlayer) 
eff = createEffect("riot_smoke",x,y,z,-90,0,0) 
  
function render() 
    if not eff then return false end 
    local x,y,z = getElementPosition(localPlayer) 
    setElementPosition(eff,x,y,z) 
end 
addEventHandler("onClientRender",root,render) 

Link to comment

attachEffect is useful function. You need declare it in your script (copy and paste source code). Also only change is this func use onClientPreRender instead of onClientRender so updating position will be smoother. And remember you need use vector, ex.

attachEffect(effect, vehicle, Vector3(0, 0, 0)) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...