RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"script a working volleyball game"
-- server script local ball = game.Workspace.Volleyball local court = game.Workspace.VolleyballCourt local team1Score = 0 local team2Score = 0 function onCollision(otherPart) if otherPart.Parent:FindFirstChild("Team") then local team = otherPart.Parent.Team.Value if team == 1 then team2Score = team2Score + 1 court.Team2Score.Value = team2Score else team1Score = team1Score + 1 court.Team1Score.Value = team1Score end end ball:SetPrimaryPartCFrame(CFrame.new(0, 10, 0)) ball.Velocity = Vector3.new(0, 0, 0) end ball.Touched:Connect(onCollision)