Everything seems to work, it just won't change the value's number whenever a ball hits it.
ModuleScript:
local gamescript = {}
function gamescript.addscore(value)
value = value + 1
end
return gamescript
Script:
local SSS = game:GetService("ServerScriptService")
local GameScript = require(SSS:WaitForChild("GameScript"))
local Values = workspace.Values
local Team1Value = Values:FindFirstChild("Team1")
local part = script.Parent
local debounce = true
part.Touched:Connect(function(hit)
if hit.Name == "Ball" and debounce then
debounce = false
print("Ball Found")
GameScript.addscore(Team1Value.Value)
wait(1)
debounce = true
end
end)
Please help.
Thanks,
LukeGabrieI
