local Shark = script.Parent
local Distance = 15
for _, player in pairs(game.Players:GetPlayers()) do
if player.Character ~= nil and player:DistanceFromCharacter(Shark.Position) <= Distance then
player.Character:FindFirstChild("Humanoid"):TakeDamage(5)
end
end
The purpose of this script is that if you come within 15 studs of the shark, you'll take 5 damage. However, it isn't working and it isn't showing anything in the output.

2 comments
It's my understanding that when copying code, the tabs get converted to spaces.
Really? I copy code all the time and the formatting works. Either way, put in the extra effort, cause it's hell reformatting code lol