Script:
function check()
local parts = workspace:GetPartsInPart(Goal, prams)
if table.find(parts, Ball) then -- Check if the instance 'Ball' is inside the array of parts
Ball.Anchored = true
game.Workspace.RedPoint:FireAllClients(Ball)
workspace.Ball.Position = Vector3.new(10, 110.5, -3)
workspace.Ball.Position = Vector3.new(-25.5, 3.799, 1)
resetRed(); resetBlue()
game.Workspace.RedPoints.Value = game.Workspace.RedPoints.Value + 1
Ball.Anchored = false
Ball.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
Ball.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
print(workspace.Ball.Value.Value.Name)
local scorer = workspace.Ball.Value.Value.Name
local scorerplayer = game.Players[scorer]
local goals = scorerplayer:FindFirstChild("leaderstats"):WaitForChild("Goals").Value
goals += 1
end
end
while task.wait(0.05) do
check()
end
The leaderstats are not updating.
Error messages: None