I get attempt to perform arithmetic (add) on number and Instance

oh yeah lol wrong perams remove plr

bc you put the wrong parameter in the local script

Okay that does not look like it should error, you properly set up the parameters. Are you certain you removed the player from FireServer in every single one of them?

@L3gendary_pr0 @ZINTICK Adding another parameter will not work, an issue is located somewhere else, most likely because @OP has been specifying the player in FireServer, when it is passed automatically

1 Like

What do you mean I should do with my script?

Ur parameter should be (player,extra,earnings)
the extra parameter will print name so its useless, the third param is the value

1 Like

Change localscript to this

print("Hello world")
local secLabel = script.Parent:WaitForChild("Sec")
local minLabel = script.Parent:WaitForChild("Min")
local seconds = 1
local minutes = 0
local on = false
local wasOn = false
local earn = 5
local earnings = 0
local moneyFrame = script.Parent.Parent:WaitForChild("Earnings")

local player = game.Players.LocalPlayer

local part = workspace.Pizza:WaitForChild("CustomerChoose")

local character = player.Character
local humanoid = character:WaitForChild("Humanoid")

--local part  = game.Workspace.Pizza.Part
local distance = (character.HumanoidRootPart.Position - part.Position).magnitude
local maxD = 10

local function stopTimer()
	seconds = 1
	minutes = 0
	secLabel.Parent.Visible = false
	moneyFrame.Visible = false
	game.ReplicatedStorage.GiveMoney:FireServer(earnings)
	earnings = 0
end

local function timerForPizza()
	
	repeat
		
		seconds += 1
		secLabel.Parent.Visible = true
		moneyFrame.Visible = true
		if seconds >= 60 then
			minutes += 1
			seconds = 0
			earnings += earn
			
		end
		secLabel.Text = tostring(seconds)
		minLabel.Text = tostring(minutes)
		
		--player.Jobs.Earn.Value += earn--Change this to the player leader stats
		moneyFrame.earn.Text = tostring(earnings)
		wait(0.5)
	until on == false


end

while wait(1) do
	if (character.HumanoidRootPart.Position - part.Position).magnitude < maxD then
		timerForPizza()
		print("Yay")
		if wasOn then
			seconds = 1
			minutes = 0
			wasOn = false
			secLabel.Parent.Visible = true
		end
	else
		print("No")
		stopTimer()
		wasOn = true
		game.ReplicatedStorage.GiveMoney:FireServer(earnings)
	end
end
2 Likes

Sometimes it works , i have suffered 1hour straight trying to realize a solution for the same problem in the past n the third param solved it

1 Like

this the place where’s your problem at Remove the player it isn’t necessary the player is passed automatically by the local script

1 Like

Great thanks for the help! I worked on this for a long time.

3 Likes

Anytime! If you hae anymore issues don’t be afraid to make another post!