Yes, this is me again. On the SWEP I’m making, how would I make it so that a player would have their own trail when they hold shift (Like how you can use the Trail Stool under render, but rather than using it on objects it is active on the player whenever they hold shift)
Can someone please help me out here? I think this code might work, but I’m not sure.
[lua] local trail = util.SpriteTrail(self, 0, Color(255,0,0), false, 15, 1, 4, 1/(15+1)*0.5, “trails/plasma.vmt”)
[/lua]
Can someone please give me some suggestions?
while ur at it, any one know how to make an animated sprite,
does it have to be a gif?
(User was banned for this post ("Thread derailing (and the answer is no—use the search button, or make a thread in Newbie Questions if you really have to)" - mahalis))
If a weapon has a trail, any player that picks it up will have the trail, erm, trail from their center, about where they hold weapons in my experience. If you add a trail to the weapon when it is initialized or picked up, it would probably work fine.
[editline]Text[/editline]
Oh wow, I’m an idiot. Didn’t fully read the post… I’m out of boxes, so if you have any to spare, yeah…
Try something like this:
[lua]
function SWEP:Initialize()
self.Trail = nil
end
function SWEP:Think()
if self.Owner:KeyDown(IN_SPEED) then
self.Trail = util.... //Create your sprite here!
else
if ValidEntity(self.Trail) then
self.Trail:Remove()
end
end
end
[/lua]
Something like that, you should get the point!