Client Particles bug (turns into random red particles)
4 replies, posted
I did my research before posting this, looked for an hour and only found things about this bug and I did all the steps like playing precache, and game.addparticles in both client and server.
Whenever I run the particles on the client they become these random red things ...
https://steamuserimages-a.akamaihd.net/ugc/912413666664672587/345BDC6A3D292DC7C5C8FDD08C8E7AA13BE7695A/
But when I run them on the server they work perfectly
https://i.gyazo.com/fb99afa5d172a568df91bf74bf3257ec.gif
But my addon is mostly client sided, so I need the particles clientsided so only certain players can see it.
-- CLIENT --
net.Receive( "ClientAbility", function( len, ply )
local id = net.ReadString()
local tab = net.ReadTable()
local x = tab[1]
local y = tab[2]
local z = tab[3]
local ent = tab[4]
RP.Abilities[id]:ClientAbility( x, y, z, ent )
end )
-- SERVER --
local function ClientAbility( ply, id, x, y, z, ent )
net.Start( "ClientAbility" )
net.WriteString( id )
net.WriteTable( { x, y, z, ent } )
net.Send( ply )
end
-- Gets called within the meteor function apon physicscollide --
-- Sends to all clients in the dimension (lets just say the "dimensions" are my splitters for the players who can see the client particles)
for k,v in pairs( player.GetAll() ) do
if v:GetDimension() == meteor:GetDimension() then
ClientAbility( v, "Meteor", explodesound, pos1, particle, nil )
end
end
function RP.Abilities.Meteor:ClientAbility( x, y, z )
sound.Play( x, y, 180 )
util.ScreenShake( y, 50, 50, 5, 100000 )
ParticleEffect(z,y,Angle( 0,0,0 ),nil)
end
Now if I decide to just call RP.Abilities.Meteor:ClientAbility( explodesound, pos1, particle ) instead of calling ClientAbility, it runs on server which results in perfect particle.
I have the particles installed everywhere including my client addons and server addons.
But still, it becomes a retarded looking red mist any ideas?
Thanks, Jacob.
function RP.Abilities.Meteor:ClientAbility( x, y, z )
sound.Play( x, y, 180 )
util.ScreenShake( y, 50, 50, 5, 100000 )
ParticleEffect(z,y,Angle( 0,0,0 ),nil)
end
This is serverside?
Shared, but its hard to explain. It's called and run on the CLIENT but its a function made in a shared file in a table.
At the top of the file, RP.Abilities is defined, and its shared apon CLIENT and SERVER, I can just call it on the server or client by doing RP.Abilities[id]:ClientAbility( x, y, z ) and I have it this way so I can change the functions value at will especially how it goes with my ability registry. ID is a string so it calls it.
Idk if you understand how this works, but lets just say a function is run on the client, in this function are particles but weirdly enough the particles appear as "red mist like" particles that can be confirmed as an ERROR.
PrecacheParticleSystem Global Function
You must run this for every particle system you wish to use on both client and server.
game.AddParticles
As well as this for every .pcf file you wish to use particle systems from, on both client and server.
Well the addon I am using is GBOMBs 4 (as im borrowing the daisy explosion particle as seen above)
I assume its already been precached and added particled because it worked perfectly on the server...
game.AddParticles( "particles/gb_daisy.pcf" )
PrecacheParticleSystem( "daisy_explo" )
PrecacheParticleSystem( "daisy_explo_air" )
PrecacheParticleSystem( "gb_daisy.pcf" )
This is in both CLIENT and SERVER, idk how to use precache so I just precached the effects I am using or do I just use the last one? As it says "The name of the particle system", and game.AddParticles is the file location.
So which one would I use as the two particles getting called from gb_daisy.pcf are daisy_explo and daisy_explo_air, sorry, I just barely understand how to precache as I never do full scale clientsided projects.
Sorry, you need to Log In to post a reply to this thread.