Ok, so to get a Player from inside a ServerScript, their are multiple ways to get the player. Now I can see you used player = script.Parent.Parent.Parent.Parent which makes me believe that you have the script inside the StarterPack or StarterGui. If so, then this should be an easy fix. All you have to do is make sure that you are getting the player and not some other random thing. I would suggest using print(player) underneath where you got all the variables;
local wood = game.ServerStorage.WoodStorage.Wood
local hits = script.Parent.Hits
part = script.Parent
player = script.Parent.Parent.Parent.Parent
timber = false
print(player)
You can then check the output and see what was printed. If it prints the players name then it should work, but if it prints anything else, then you haven't got the player, and you might need to add or take away a few .Parents inside the player variable.
If your script ISN'T inside either the StarterPack or StarterGui, then you have to get the player a different way.
But for this, I would suggest that you make sure it is in the StarterPack or StarterGui, and make sure that you got the player, and not something inside the player.
Hope this helped and be sure to +1 and accept answer.
If this didn't, then please reply back with what the print(player) printed in the output and I can help you out.
2 comments
It does print the player's name, but it returns nil.
Do print(player.Parent) Obviously you must have the player in the workspace or something, cause it should work if it is already printing player.