-- when R is held down begin pause when released unpause

UIS.InputBegan:Connect(function(i, g)
        if i.KeyCode ~= Enum.KeyCode.R then return end

        game.ReplicatedStorage.pause:FireServer()
end)
UIS.InputEnded:Connect(function(i, g)
        if i.KeyCode~=Enum.KeyCode.R then return end
        game.ReplicatedStorage.unpause:FireServer()
end)
