New Explosion Effect fix with env_physexplosion, how to?
7 replies, posted
Hello,
well I'm gonna fix the code from this famous addon ([url]http://www.garrysmod.org/downloads/?a=view&id=120123[/url]) and I'd like to add with "local explode = ents.FindByClass("env_explosion" )" this "env_physexplosion", because this script disable "env_physexplosion" on your map and I'd like to fix that.
I don't know a lot in Lua, and I wish you can help me for this.
Here is the code:
[lua]
function Splode()
local explode = ents.FindByClass("env_explosion" )
for k,v in pairs( explode ) do
if( v:IsValid() ) then
local Pos = v:LocalToWorld( v:OBBCenter( ) )
ParticleEffect("dusty_explosion_rockets", Pos, Angle(0,0,0), nil)
v:Remove()
end
end
end
hook.Add("Think", "Splode", Splode)
[/lua]
I tried things like this :
[lua]
function Splode()
local explode = ents.FindByClass("env_explosion"); or ("env_physexplosion")
for k,v in pairs( explode ) do
if( v:IsValid() ) then
local Pos = v:LocalToWorld( v:OBBCenter( ) )
ParticleEffect("dusty_explosion_rockets", Pos, Angle(0,0,0), nil)
v:Remove()
end
end
end
hook.Add("Think", "Splode", Splode)
[/lua]
But it still doesn't work :(. Can you help?
[QUOTE=Loucouss;29671995]
[lua]
local explode = ents.FindByClass("env_explosion"); or ("env_physexplosion")
[/lua]
[/quote]
You should learn lua before even trying to "fix" things.
[QUOTE=Wizard of Ass;29672093]You should learn lua before even trying to "fix" things.[/QUOTE]
Well, it's a friend of mine who did that directly on Steam to help me...
But, can you help?
If you don't no lua how can you expect to fix something
[QUOTE=King Flawless;29672318]If you don't no lua how can you expect to fix something[/QUOTE]
I'm just asking how to fix one line of code. That's why I'm asking on Facepunch.
So I see you're posting here, can you help or can you just saying useless things?
The codeer of the project is still developing it ask him because you clearly have no idea what your doing and that one line of code
[lua]local explode = ents.FindByClass("env_explosion"); or ("env_physexplosion")[/lua]
Shows you have 0 understanding of lua FindByClass outputs a table an empty table isn't nil
Basicly, it's not my own code. I just wanted the new explosion effects work too with "env_physexplosion" like it works with "env_explosion"
[QUOTE=Loucouss;29672975]Basicly, it's not my own code.[/QUOTE]
[QUOTE=Loucouss;29671995]
I tried things like this :
[/QUOTE]
[QUOTE=Loucouss;29671995]
I tried
[/QUOTE]
[QUOTE=Loucouss;29671995]
I
[/QUOTE]
Right...
Sorry, you need to Log In to post a reply to this thread.