Type OnHit(plr, hit) in your raycast section
Do you have a way to get the player that shot the gun?
Also put it after
local hitObjec, hitPos....
OnHit(plr, hitObject)
Could I use script.Parent.Parent to get who shot it
You should be firing a remoteevent from your localscript.
I have to go, but good luck. Here are some things you have to remember.
- Don’t rename the Humanoid
- TakeDamage can only be called on serverScript
- Use this link: RemoteEvent | Documentation - Roblox Creator Hub
wait why do you have to go right now nothing is working?
Don’t save your game, close out of it, and revert the version of the game. Read the posts I’ve sent up there, and try to figure it out. Sorry, I have to go, but I wish you the best of luck.