• TTT Weapon Switching by itself
    4 replies, posted
I have a lightsaber as a crowbar and ever so often it will randomly switch to that weapon while shooting or just randomly. Others on my server are having this problem. Also, sometimes in spectator mode, someone will still have the lightsaber and be able to hit people with it who are still alive. I do not really know where to start to fix this.. any ideas? Here is the pointshop code I have for the lightsaber: [CODE]ITEM.Name = 'Lightsaber' ITEM.Price = 5000 ITEM.Model = 'models/weapons/v_lrowbar.mdl' ITEM.WeaponClass = 'weapon_ttt_lightsaber' ITEM.SingleUse = false ITEM.AllowedUserGroups = { "owner", "doperator", "dadmin", "dsuperadmin", "donator"} function ITEM:OnEquip(ply) if not ply:Alive() then return end ply:StripWeapon('weapon_zm_improvised') ply:Give(self.WeaponClass) ply:SelectWeapon(self.WeaponClass) end function ITEM:OnHolster(ply) if not ply:Alive() then return end ply:StripWeapon(self.WeaponClass) ply:Give('weapon_zm_improvised') ply:SelectWeapon('weapon_zm_improvised') end function ITEM:PlayerSpawn(ply) ply:StripWeapon('weapon_zm_improvised') ply:Give(self.WeaponClass) ply:SelectWeapon(self.WeaponClass) end[/CODE] and the lightsaber I use is: [url]http://steamcommunity.com/sharedfiles/filedetails/?id=170944590[/url] [editline]15th July 2014[/editline] And apparently its happening to the deagle to...
Not sure about your first issue, but for your second issue, strip the lightsaber as a precaution in a PlayerDeath hook.
[CODE]function ITEM:PlayerDeath(ply) ply:StripWeapon('weapon_ttt_lightsaber') end [/CODE] I've never done that before.. so is that how it would be?
I was thinking a PlayerDeath hook, but that looks like it would work if I remember how ITEM functions work correctly. Worth a shot.
Hmm.. that just made it randomly unequip and re equip to people...
Sorry, you need to Log In to post a reply to this thread.