It is a little more complicated to find the local player via global script, although it can still be achieved.
One way that the player can be found would be to do the following:
1 | game.Players.PlayerAdded:connect( function (plr) |
In this case, 'plr' would be that local player.
In addition to finding the player by a PlayerAdded event, it can also be achieved via the Touched event:
1 | script.Parent.Touched:connect( function (hit) |
2 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
3 | local player = hit.Parent:GetPlayerFromCharacter() |