I’m trying to get the Total number by adding the price to the total value in a module script, though the addition of price is not recorded and I always end up with zero being outputted in the script. How do I send the Total variable to the script.
My test price is set to 5 so It should be outputting 5 not 0
I have a script in workspace with this code inside:
local system = {}
Scanner.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Price") and Hit.Parent.Parent.Name == Player.Name and Plr.Value ~= "" then
module.scanItem(Hit,Scanner,Total,System,TILLNUMBER)
print(Total)
end
end)
return system
and in the module script in SSS:
local module = require(game.ServerScriptService.ModuleScript)
system.scanItem = function(Hit,Scanner,Total,System,TILLNUMBER)
local price = Hit.Parent:FindFirstChild("Price").Value
Total = Total+price
return(Total)
end