How to make this seeable for everyone else

How do I make this script a Server Script without it breaking? When I tried to make it a server script, I got this error

local MaxUses = 3 -- add one up due to bug
local HungerPerUse = 2
local MaxHunger = 18.1

local Player = game.Players.LocalPlayer
local Hunger = Player:WaitForChild("HungerVal")
local Tool = script.Parent
local Handle = Tool:WaitForChild("Handle")
local OpenSound  = Tool.Handle:WaitForChild("CanOpen")
local ScoopSound = Tool.Handle:WaitForChild("SpoonScope")

local EatAnimation = Tool:WaitForChild("EatAnim")
local OpenAnimation = Tool:WaitForChild("OpenAnim") 
local TossAnimation = Tool:WaitForChild("TossAnim")

local Character = nil
local Humanoid = nil
Tool.Equipped:Connect(function()
	local tCharacter = Tool.Parent
	if game.Players:GetPlayerFromCharacter(tCharacter) then
		Character = tCharacter
		Humanoid = Character:FindFirstChildOfClass("Humanoid")
	end
end)


local ResetTime = 2 -- cooldown to eating
local isUsed = false  -- Declare debounce variable

local CanOpened = false
local Busy = false
Tool.Activated:Connect(function() -- opening the can
	if not Character or not Humanoid then Busy = false return end
	if Busy then return end
	if not CanOpened then
	Busy = true
		
		
		local OpenCanAnim = Humanoid:LoadAnimation(OpenAnimation)
		OpenCanAnim:Play()
		wait(0.5)
		OpenSound:Play()		
		wait(0.2)	
		Handle.ClosedCover.Transparency = 1
		Handle.OpenCover.Transparency = 0		
		wait(1)
		CanOpened = true
		Busy = false
			
		
			
		return
	end
	Busy = true
	MaxUses -= 1
	if MaxUses <= 0 then 
		
	local TossAnim = Humanoid:LoadAnimation(TossAnimation) -- throwing away the can
	TossAnim:Play()
	wait(0.5)
	Handle.Transparency = 1
	Handle.OpenCover.Transparency = 1	
	Handle.Beans.Transparency = 1	
	Handle.ThrowCan:Play()
	local Can = game.ReplicatedStorage.DetailStuff.Cans.CanBeans:Clone()
	Can.Position = Handle.Position
	Can.Parent = workspace	
		
	wait(0.25)
	Handle:Destroy() 
	Tool:Destroy() 
	print("Tool Destroyed")
		
	return end
	
	if not isUsed then  -- Check that debounce variable is not true
	isUsed = true  -- Set variable to true
		
	local StarterGui = game:GetService("StarterGui")	
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) -- disable inventory	
	local EatAnim = Humanoid:LoadAnimation(EatAnimation) -- eating the can
	EatAnim:Play()
	Player.Character.LeftHand.Spoon.Transparency = 0	
	wait(1)
	ScoopSound:Play()
	Hunger.Value = math.clamp(Hunger.Value + HungerPerUse, 0, MaxHunger) -- first spoonful
	wait(2)
	ScoopSound:Play()	
	wait(0.1)
	Hunger.Value = math.clamp(Hunger.Value + HungerPerUse, 0, MaxHunger) -- second spoonful
	wait(1.8)	
	Player.Character.LeftHand.Spoon.Transparency = 1		
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)  -- enable inventory
	wait(ResetTime)  -- Wait for reset time duration
	isUsed = false  -- Reset variable to false	
	
	Busy = false
	end
	end)

There seems to be many issues. One of them is this. You can only use localplayer inside of local scripts for a clear reason.

An example:

image
image

This is the error you posted seems to be this one.

image

If this script is inside of a tool you probs would need to do something like below to get the player not local player:

local Player = Tool.Parent.Parent

The reason why you would do above instead of what u currently have is because like I said the localplayer only works in a local script so you would need to get the player from the tool instead.

image

I put the tool inside of the StarterPack and added local Player = Tool.Parent.Parent rather than local Player = game.Players.LocalPlayer. When I clicked play to test it, it didn’t work, and there weren’t any errors in output.

I got this infinite error though: