Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Part of script that is supposed to push people by hitting them, but it's not working?

Asked by 5 years ago

Hi guys, so lately I've been making a simple gun system, and I've added a melee (which is just hitting with the gun itself). This is the code: tool.Base.Touched:connect(function(hit) if meleeing and hit and hit.Parent and hit.Parent ~= tagged and hit.Anchored == false then tagged = hit.Parent hit.Velocity = character.Torso.CFrame.lookVector * 60 wait(.5) tagged = nil end end) So, my problem is: This part of the script does not work on players, but for some reason works on NPCs. Can someone explain to me what's the problem? I'd really appreciate it.

Answer this question