Expected end to close function

Hey so I’m working on a local selling script it keeps saying expected end to close function I’m still new to this so any help would be appreciated here is the script

local Machine = game.Workspace.Sell
local PP = Machine.ProximityPrompt

PP.Triggered:Connect(function(player)
local stat = player.Stats
if stat.Paper.Value < 1 then
end
elseif stat.Paper.Value > 1 then
stat.Paper.Value = stat.Paper.Value - 1
stat.Coins.Value = stat.Coins.Value + 1
end
end)

1 Like
local Machine = game.Workspace.Sell
local PP = Machine.ProximityPrompt

PP.Triggered:Connect(function(player)
	local stat = player.Stats
	if stat.Paper.Value < 1 then
		return
	elseif stat.Paper.Value > 1 then
		stat.Paper.Value = stat.Paper.Value - 1
		stat.Coins.Value = stat.Coins.Value + 1
	end
end)

Thank you for your time, I will select it as a solution.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.