How would i get the local player from workspace

how would i get the local player from workspace like

local player = game.Workspace.LocalPlayer

because im trying to make a limit for how long you can have this gun for

if script.Parent.Parent == game.Workspace.LocalPlayer then
	wait(60)
	game.Workspace.LocalPlayer:WaitForChild("HyperlaserGun"):Destroy()
end

Workspace’s local player is the player’s character. You can get it using game.Players.LocalPlayer.Character.

2 Likes