RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make rock paper siccsors"
-- client script for rock paper scissors game local player = game.Players.LocalPlayer local mouse = player:GetMouse() local gui = player.PlayerGui:WaitForChild("RockPaperScissorsGui") local rockButton = gui:WaitForChild("RockButton") local paperButton = gui:WaitForChild("PaperButton") local scissorsButton = gui:WaitForChild("ScissorsButton") local resultLabel = gui:WaitForChild("ResultLabel") local function playRound(playerChoice) local choices = {"rock", "paper", "scissors"} local computerChoice = choices[math.random(1,3)] if playerChoice == computerChoice then resultLabel.Text = "Tie!" elseif (playerChoice == "rock" and computerChoice == "scissors") or (playerChoice == "paper" and computerChoice == "rock") or (playerChoice == "scissors" and computerChoice == "paper") then resultLabel.Text = "You win!" else resultLabel.Text = "You lose!" end end rockButton.MouseButton1Click:Connect(function() playRound("rock") end) paperButton.MouseButton1Click:Connect(function() playRound("paper") end) scissorsButton.MouseButton1Click:Connect(function() playRound("scissors") end)