RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"goal score for ball"
-- script for goal local goalPart = script.Parent local ball = game.Workspace.Ball local goalScored = false local function goalScoredFunction() if not goalScored then goalScored = true local players = game:GetService("Players") for _, player in ipairs(players:GetPlayers()) do player.leaderstats.Goals.Value = player.leaderstats.Goals.Value + 1 end ball.Position = Vector3.new(0, 5, 0) -- Reset ball position wait(3) goalScored = false end end goalPart.Touched:Connect(function(hit) if hit == ball then goalScoredFunction() end end)