So when the players Press a Key, they get a point, then a countdown appears and a new Random Key is appeared, when players press that second random Key, they get **+3 points, ** when they press the Third Random key they get +6 Points, why?
local UIS = game:GetService("UserInputService")
local randomKey = workspace.Rooms.RoomOne.randomKey
local player = game.Players.LocalPlayer
local RoomOneTable = require(game.ReplicatedStorage.Rooms.RoomOne.RoomOneMod)
local restartRound = game.ReplicatedStorage.Rooms.RoomOne.restartRound
local defaultKey = game.ReplicatedStorage.Rooms.RoomOne.keyDefault -- set the random key to default
local canPressFalse = game.ReplicatedStorage.Rooms.RoomOne.canPressFalse
local canPress = workspace.Rooms.RoomOne.canPress
workspace.Rooms.RoomOne.randomKey.Changed:Connect(function()
workspace.Rooms.RoomOne.newRound.Value = true
end)
while wait(1) do
if workspace.Rooms.RoomOne.newRound.Value == true then
if player:FindFirstChild("thePointsOne") then
UIS.InputBegan:Connect(function(key, whileTalking)
if whileTalking then return end
while wait() do
if canPress.Value == true then
-- if players can press
if player.thePointsOne.Value == 5 then
print("You won the game")
else
if key.KeyCode == Enum.KeyCode[randomKey.Value] then
print(player.Name.." Won a point!")
canPressFalse:FireServer()
restartRound:FireServer()
player.thePointsOne.Value = player.thePointsOne.Value + 1
break
end
end
else
print("Wait")
break
end
end -- loop
end)
end
end
end
