roblox studio how to use localplayer in script code example
Example: localplayer lua
local localplayer = game.Players.LocalPlayer
print(localplayer.Name) -- prints localplayer name
local localplayer = game.Players.LocalPlayer
print(localplayer.Name) -- prints localplayer name