Is there an alternative to using localplayer without using touched/hit function?
Well if the script is a child direct child of the player then just use
local player = script.parent
but if it is let's say in a tool that is a direct child of the player then use
local player = script.parent.parent
And so on and so on, that makes it where you can just use the keyword "player" to refer to the player that the script is running for. Hope that helped